1 <?php declare(strict_types=1);
47 $clone->evaluation = $clone->evaluation->withContextUser($user);
58 $this->matchingDocumentsByUser[(int) $this->
user->getId()] = [];
60 $this->log->debug(sprintf(
61 'Evaluating document for user "%s" (id: %s) ...',
62 $this->
user->getLogin(),
66 foreach ($this->possibleDocuments as $document) {
68 $this->matchingDocumentsByUser[(int) $this->
user->getId()][] = $document;
72 $this->log->debug(sprintf(
73 '%s matching document(s) found',
74 count($this->matchingDocumentsByUser[(
int) $this->
user->getId()])
78 return $this->matchingDocumentsByUser[(int) $this->
user->getId()];
86 return $this->evaluation->evaluate($document);
95 if (count($matchingDocuments) > 0) {
96 return $matchingDocuments[0];
100 'Could not find any terms of service document for the passed user (id: %s|login: %s)',
101 $this->
user->getId(),
102 $this->
user->getLogin()
__construct(ilTermsOfServiceDocumentCriteriaEvaluation $evaluation, ilObjUser $user, ilLogger $log, array $possibleDocuments)
ilTermsOfServiceDocumentLogicalAndCriteriaEvaluation constructor.
Interface ilTermsOfServiceSequentialDocumentEvaluation.
Interface ilTermsOfServiceDocumentEvaluation.
Interface ilTermsOfServiceDocumentCriteriaEvaluation.
withContextUser(ilObjUser $user)
Returns an evaluator like this with the passed context user.ilTermsOfServiceDocumentEvaluation ...
Class ilTermsOfServiceNoSignableDocumentFoundException.
Interface ilTermsOfServiceSignableDocument.
Component logger with individual log levels by component id.
evaluateDocument(ilTermsOfServiceSignableDocument $document)
document()
Determines a document based on the context of the concrete implementation.ilTermsOfServiceSignableDoc...