Doctrine\MongoDB\Query\Builder::field PHP Method

field() public method

Set the current field for building the expression.
See also: Expr::field()
public field ( string $field )
$field string
    public function field($field)
    {
        $this->expr->field((string) $field);
        return $this;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * {inheritdoc}.
  */
 protected function applyCriteria(QueryBuilder $queryBuilder, array $criteria = null)
 {
     if (null === $criteria) {
         return;
     }
     foreach ($criteria as $property => $value) {
         if (is_array($value)) {
             $queryBuilder->field($this->getPropertyName($property))->in($value);
         } elseif ('' !== $value) {
             $queryBuilder->field($this->getPropertyName($property))->equals($value);
         }
     }
 }
All Usage Examples Of Doctrine\MongoDB\Query\Builder::field