19 declare(strict_types=1);
51 $this->log->debug(sprintf(
52 'Evaluating criteria for document "%s" (id: %s) and user "%s" (id: %s)',
55 $this->
user->getLogin(),
59 foreach ($document->
criteria() as $criterionAssignment) {
60 $criterionType = $this->criterionTypeFactory->findByTypeIdent($criterionAssignment->getCriterionId(),
true);
62 $result = $criterionType->evaluate($this->
user, $criterionAssignment->getCriterionValue());
64 $this->log->debug(sprintf(
65 'Criterion of type "%s", configured with %s evaluated: %s',
66 $criterionType->getTypeIdent(),
67 var_export($criterionAssignment->getCriterionValue()->toJson(),
true),
68 var_export($result,
true)
evaluate(ilTermsOfServiceSignableDocument $document)
Evaluates a document for the context given by the concrete implementation.
Interface ilTermsOfServiceLogicalAndDocumentCriteriaEvaluation.
Interface ilTermsOfServiceDocumentCriteriaEvaluation.
__construct(ilTermsOfServiceCriterionTypeFactoryInterface $criterionTypeFactory, ilObjUser $user, ilLogger $log)
withContextUser(ilObjUser $user)
Returns a criteria evaluator like this with the passed context user.
ilTermsOfServiceCriterionTypeFactoryInterface $criterionTypeFactory
Interface ilTermsOfServiceSignableDocument.
Interface ilTermsOfServiceCriterionTypeFactoryInterface.