Neos\Flow\Reflection\ClassSchema::isMultiValuedProperty PHP Метод

isMultiValuedProperty() публичный Метод

array or SplObjectStorage).
public isMultiValuedProperty ( string $propertyName ) : boolean
$propertyName string
Результат boolean
    public function isMultiValuedProperty($propertyName)
    {
        return $this->properties[$propertyName]['type'] === 'array' || $this->properties[$propertyName]['type'] === 'SplObjectStorage' || $this->properties[$propertyName]['type'] === 'Doctrine\\Common\\Collections\\Collection' || $this->properties[$propertyName]['type'] === 'Doctrine\\Common\\Collections\\ArrayCollection';
    }

Usage Example

Пример #1
0
 /**
  * Returns a greater than or equal criterion used for matching objects against a query
  *
  * @param string $propertyName The name of the property to compare against
  * @param mixed $operand The value to compare with
  * @return Qom\Comparison
  * @throws InvalidQueryException if used on a multi-valued property or with a non-literal/non-DateTime operand
  * @api
  */
 public function greaterThanOrEqual($propertyName, $operand)
 {
     if ($this->classSchema->isMultiValuedProperty($propertyName)) {
         throw new InvalidQueryException('Property "' . $propertyName . '" must not be multi-valued', 1276774883);
     }
     if (!$operand instanceof \DateTimeInterface && !TypeHandling::isLiteral(gettype($operand))) {
         throw new InvalidQueryException('Operand must be a literal or DateTime, was ' . gettype($operand), 1276774884);
     }
     return $this->qomFactory->comparison($this->qomFactory->propertyValue($propertyName, '_entity'), QueryInterface::OPERATOR_GREATER_THAN_OR_EQUAL_TO, $operand);
 }
All Usage Examples Of Neos\Flow\Reflection\ClassSchema::isMultiValuedProperty