class ExpressionBuilder

Builder for Expressions in the {@link Selectable} interface.

@author Benjamin Eberlei <kontakt@beberlei.de> @since 2.3

Hierarchy

Expanded class hierarchy of ExpressionBuilder

2 files declare their use of ExpressionBuilder
ClosureExpressionVisitorTest.php in drupal/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Collections/ClosureExpressionVisitorTest.php
ExpressionBuilderTest.php in drupal/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Collections/ExpressionBuilderTest.php

File

drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Collections/ExpressionBuilder.php, line 32

Namespace

Doctrine\Common\Collections
View source
class ExpressionBuilder {

  /**
   * @return CompositeExpression
   */
  public function andX($x = null) {
    return new CompositeExpression(CompositeExpression::TYPE_AND, func_get_args());
  }

  /**
   * @return CompositeExpression
   */
  public function orX($x = null) {
    return new CompositeExpression(CompositeExpression::TYPE_OR, func_get_args());
  }

  /**
   * @param string $field
   * @param mixed $value
   *
   * @return Comparison
   */
  public function eq($field, $value) {
    return new Comparison($field, Comparison::EQ, new Value($value));
  }

  /**
   * @param string $field
   * @param mixed $value
   *
   * @return Comparison
   */
  public function gt($field, $value) {
    return new Comparison($field, Comparison::GT, new Value($value));
  }

  /**
   * @param string $field
   * @param mixed $value
   *
   * @return Comparison
   */
  public function lt($field, $value) {
    return new Comparison($field, Comparison::LT, new Value($value));
  }

  /**
   * @param string $field
   * @param mixed $value
   *
   * @return Comparison
   */
  public function gte($field, $value) {
    return new Comparison($field, Comparison::GTE, new Value($value));
  }

  /**
   * @param string $field
   * @param mixed $value
   *
   * @return Comparison
   */
  public function lte($field, $value) {
    return new Comparison($field, Comparison::LTE, new Value($value));
  }

  /**
   * @param string $field
   * @param mixed $value
   *
   * @return Comparison
   */
  public function neq($field, $value) {
    return new Comparison($field, Comparison::NEQ, new Value($value));
  }

  /**
   * @param string $field
   * @param mixed $value
   *
   * @return Comparison
   */
  public function isNull($field) {
    return new Comparison($field, Comparison::IS, new Value(null));
  }

  /**
   * @param string $field
   * @param mixed $value
   *
   * @return Comparison
   */
  public function in($field, array $values) {
    return new Comparison($field, Comparison::IN, new Value($values));
  }

  /**
   * @param string $field
   * @param mixed $value
   *
   * @return Comparison
   */
  public function notIn($field, array $values) {
    return new Comparison($field, Comparison::NIN, new Value($values));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ExpressionBuilder::andX public function
ExpressionBuilder::eq public function
ExpressionBuilder::gt public function
ExpressionBuilder::gte public function
ExpressionBuilder::in public function
ExpressionBuilder::isNull public function
ExpressionBuilder::lt public function
ExpressionBuilder::lte public function
ExpressionBuilder::neq public function
ExpressionBuilder::notIn public function
ExpressionBuilder::orX public function