Neos\Flow\Security\Authorization\Privilege\Entity\Doctrine\PropertyConditionGenerator::equals PHP Méthode

equals() public méthode

public equals ( string | array $operandDefinition ) : PropertyConditionGenerator
$operandDefinition string | array
Résultat PropertyConditionGenerator the current instance to allow for method chaining
    public function equals($operandDefinition)
    {
        $this->operator = '==';
        $this->operandDefinition = $operandDefinition;
        $this->operand = $this->getValueForOperand($operandDefinition);
        return $this;
    }

Usage Example

 /**
  * @param string $nodePathOrIdentifier
  * @return PropertyConditionGenerator
  */
 public function isDescendantNodeOf($nodePathOrIdentifier)
 {
     if (preg_match(UuidValidator::PATTERN_MATCH_UUID, $nodePathOrIdentifier) === 1) {
         $node = $this->getNodeByIdentifier($nodePathOrIdentifier);
         if ($node === null) {
             return new FalseConditionGenerator();
         }
         $nodePath = $node->getPath();
     } else {
         $nodePath = rtrim($nodePathOrIdentifier, '/');
     }
     $propertyConditionGenerator1 = new PropertyConditionGenerator('path');
     $propertyConditionGenerator2 = new PropertyConditionGenerator('path');
     return new DisjunctionGenerator(array($propertyConditionGenerator1->like($nodePath . '/%'), $propertyConditionGenerator2->equals($nodePath)));
 }