Sulu\Component\Rest\ListBuilder\Doctrine\FieldDescriptor\AbstractDoctrineFieldDescriptor::getWhere PHP Method

getWhere() public method

public getWhere ( )
    public function getWhere()
    {
        return $this->getSelect();
    }

Usage Example

コード例 #1
0
ファイル: DoctrineWhereExpression.php プロジェクト: sulu/sulu
 /**
  * {@inheritdoc}
  */
 public function getStatement(QueryBuilder $queryBuilder)
 {
     $paramName = $this->getFieldName() . $this->getUniqueId();
     if ($this->getValue() === null) {
         return $this->field->getSelect() . ' ' . $this->convertNullComparator($this->getComparator());
     } elseif ($this->getComparator() === 'LIKE') {
         $queryBuilder->setParameter($paramName, '%' . $this->getValue() . '%');
     } elseif (in_array($this->getComparator(), ['and', 'or']) && is_array($this->getValue())) {
         $statement = [];
         $value = $this->getValue();
         for ($i = 0, $count = count($value); $i < $count; ++$i) {
             $statement[] = sprintf('%s = :%s%s', $this->field->getWhere(), $paramName, $i);
             $queryBuilder->setParameter($paramName . $i, $value[$i]);
         }
         return implode(' ' . $this->getComparator() . ' ', $statement);
     } else {
         $queryBuilder->setParameter($paramName, $this->getValue());
     }
     return $this->field->getWhere() . ' ' . $this->getComparator() . ' :' . $paramName;
 }
AbstractDoctrineFieldDescriptor