1 <?php declare(strict_types=1);
49 $this->log->debug(sprintf(
50 'Evaluating criteria for document "%s" (id: %s) and user "%s" (id: %s)',
53 $this->
user->getLogin(),
57 foreach ($document->
criteria() as $criterionAssignment) {
58 $criterionType = $this->criterionTypeFactory->findByTypeIdent($criterionAssignment->getCriterionId(),
true);
60 $result = $criterionType->evaluate($this->
user, $criterionAssignment->getCriterionValue());
62 $this->log->debug(sprintf(
63 'Criterion of type "%s", configured with %s evaluated: %s',
64 $criterionType->getTypeIdent(),
65 var_export($criterionAssignment->getCriterionValue()->toJson(),
true),
evaluate(ilTermsOfServiceSignableDocument $document)
Evaluates a document for the context given by the concrete implementation.bool
Interface ilTermsOfServiceLogicalAndDocumentCriteriaEvaluation.
Interface ilTermsOfServiceDocumentCriteriaEvaluation.
__construct(ilTermsOfServiceCriterionTypeFactoryInterface $criterionTypeFactory, ilObjUser $user, ilLogger $log)
ilTermsOfServiceDocumentLogicalAndCriteriaEvaluation constructor.
withContextUser(ilObjUser $user)
Returns a criteria evaluator like this with the passed context user.ilTermsOfServiceDocumentCriteriaE...
Interface ilTermsOfServiceSignableDocument.
Component logger with individual log levels by component id.
Interface ilTermsOfServiceCriterionTypeFactoryInterface.