Neos\Flow\Persistence\Doctrine\Query::matching PHP Метод

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

The constraint used to limit the result set. Returns $this to allow for chaining (fluid interface)
public matching ( object $constraint ) : Neos\Flow\Persistence\QueryInterface
$constraint object Some constraint, depending on the backend
Результат Neos\Flow\Persistence\QueryInterface
    public function matching($constraint)
    {
        $this->constraint = $constraint;
        $this->queryBuilder->where($constraint);
        return $this;
    }

Usage Example

 /**
  * @param ClassMetadata $targetEntity
  * @param string $targetEntityPropertyName
  * @return Query
  */
 protected function getSubselectQuery(ClassMetadata $targetEntity, $targetEntityPropertyName)
 {
     $subselectQuery = new Query($targetEntity->getAssociationTargetClass($targetEntityPropertyName));
     $propertyName = str_replace($targetEntityPropertyName . '.', '', $this->path);
     switch ($this->operator) {
         case '==':
             $subselectConstraint = $subselectQuery->equals($propertyName, $this->operand);
             break;
         case '!=':
             $subselectConstraint = $subselectQuery->logicalNot($subselectQuery->equals($propertyName, $this->operand));
             break;
         case '<':
             $subselectConstraint = $subselectQuery->lessThan($propertyName, $this->operand);
             break;
         case '>':
             $subselectConstraint = $subselectQuery->greaterThan($propertyName, $this->operand);
             break;
         case '<=':
             $subselectConstraint = $subselectQuery->lessThanOrEqual($propertyName, $this->operand);
             break;
         case '>=':
             $subselectConstraint = $subselectQuery->greaterThanOrEqual($propertyName, $this->operand);
             break;
         case 'like':
             $subselectConstraint = $subselectQuery->like($propertyName, $this->operand);
             break;
         case 'in':
             $subselectConstraint = $subselectQuery->in($propertyName, $this->operand);
             break;
     }
     $subselectQuery->matching($subselectConstraint);
     return $subselectQuery;
 }
All Usage Examples Of Neos\Flow\Persistence\Doctrine\Query::matching