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;
89 if ($value->getCriterionId() !== $otherValue->getCriterionId()) {
93 $valuesHaveSameNature = $this->criterionTypeFactory->findByTypeIdent($value->
getCriterionId())->hasUniqueNature();
95 return $valuesHaveSameNature;
An exception for terminatinating execution or to throw for unit testing.
Class ilTermsOfServiceDocumentCriterionAssignmentConstraint.
filterEqualValues(ilTermsOfServiceDocumentCriterionAssignment $value)
haveSameNature(ilTermsOfServiceDocumentCriterionAssignment $value, ilTermsOfServiceDocumentCriterionAssignment $otherValue)
__construct(ilTermsOfServiceCriterionTypeFactoryInterface $criterionTypeFactory, ilTermsOfServiceDocument $document, Factory $dataFactory, ilLanguage $lng)
ilTermsOfServiceDocumentCriterionAssignmentConstraint constructor.
Class ilTermsOfServiceDocumentCriterionAssignment.
equals($other)
@inheritDoc
Class ilTermsOfServiceDocument.
if(!file_exists(getcwd() . '/ilias.ini.php'))
registration confirmation script for ilias
Interface ilTermsOfServiceCriterionTypeFactoryInterface.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc