1 <?php declare(strict_types=1);
39 function (
$txt, $value) {
40 return "The passed assignment must be unique for the document!";
54 $otherValues = $this->document->criteria();
59 $idCurrent = $otherValue->getId();
60 $idNew = $value->getId();
62 $uniqueIdEquals = $idCurrent === $idNew;
63 if ($uniqueIdEquals) {
67 $valuesEqual = $value->
equals($otherValue);
72 $valuesHaveSameNature = $this->
haveSameNature($value, $otherValue);
74 return $valuesHaveSameNature;
93 $valuesHaveSameNature = $this->criterionTypeFactory->findByTypeIdent($value->
getCriterionId())->hasUniqueNature();
95 return $valuesHaveSameNature;
__construct(ilTermsOfServiceCriterionTypeFactoryInterface $criterionTypeFactory, ilTermsOfServiceDocument $document, Factory $dataFactory, ilLanguage $lng)
ilTermsOfServiceDocumentCriterionAssignmentConstraint constructor.
haveSameNature(ilTermsOfServiceDocumentCriterionAssignment $value, ilTermsOfServiceDocumentCriterionAssignment $otherValue)
Class ilTermsOfServiceDocumentCriterionAssignment.
Class ilTermsOfServiceDocument.
filterEqualValues(ilTermsOfServiceDocumentCriterionAssignment $value)
__construct(Container $dic, ilPlugin $plugin)
Class ilTermsOfServiceDocumentCriterionAssignmentConstraint.
Interface ilTermsOfServiceCriterionTypeFactoryInterface.