Esempio n. 1
0
 /**
  * {@inheritdoc}
  *
  * @param mixed $value
  * @param string $operator
  * @param mixed $operand
  * @return boolean
  */
 protected function evaluateOperator($value, $operator, $operand)
 {
     if ($operator === 'instanceof') {
         if ($this->operandIsSimpleType($operand)) {
             return $this->handleSimpleTypeOperand($operand, $value);
         } elseif ($operand === 'TYPO3\\TYPO3CR\\Domain\\Model\\NodeInterface') {
             return TRUE;
         } else {
             return $value->getContentType()->isOfType($operand);
         }
     } else {
         return parent::evaluateOperator($value, $operator, $operand);
     }
 }
 /**
  * {@inheritdoc}
  *
  * @param mixed $value
  * @param string $operator
  * @param mixed $operand
  * @return boolean
  */
 protected function evaluateOperator($value, $operator, $operand)
 {
     if ($operator === 'instanceof' && $value instanceof \TYPO3\TYPO3CR\Domain\Model\NodeInterface) {
         if ($this->operandIsSimpleType($operand)) {
             return $this->handleSimpleTypeOperand($operand, $value);
         } elseif ($operand === 'TYPO3\\TYPO3CR\\Domain\\Model\\NodeInterface' || $operand === 'TYPO3\\TYPO3CR\\Domain\\Model\\Node') {
             return TRUE;
         } else {
             $isOfType = $value->getNodeType()->isOfType($operand[0] === '!' ? substr($operand, 1) : $operand);
             return $operand[0] === '!' ? $isOfType === FALSE : $isOfType;
         }
     }
     return parent::evaluateOperator($value, $operator, $operand);
 }
 /**
  * {@inheritdoc}
  *
  * @param mixed $value
  * @param string $operator
  * @param mixed $operand
  * @return boolean
  */
 protected function evaluateOperator($value, $operator, $operand)
 {
     if ($operator === 'instanceof' && $value instanceof NodeInterface) {
         if ($this->operandIsSimpleType($operand)) {
             return $this->handleSimpleTypeOperand($operand, $value);
         } elseif ($operand === NodeInterface::class || $operand === Node::class) {
             return true;
         } else {
             $isOfType = $value->getNodeType()->isOfType($operand[0] === '!' ? substr($operand, 1) : $operand);
             return $operand[0] === '!' ? $isOfType === false : $isOfType;
         }
     } elseif ($operator === '!instanceof' && $value instanceof NodeInterface) {
         return !$this->evaluateOperator($value, 'instanceof', $operand);
     }
     return parent::evaluateOperator($value, $operator, $operand);
 }