class ExpressionBuilder in Plug 7
Builder for Expressions in the {@link Selectable} interface.
Important Notice for interoperable code: You have to use scalar values only for comparisons, otherwise the behavior of the comparision may be different between implementations (Array vs ORM vs ODM).
@author Benjamin Eberlei <kontakt@beberlei.de> @since 2.3
Hierarchy
- class \Doctrine\Common\Collections\ExpressionBuilder
Expanded class hierarchy of ExpressionBuilder
2 files declare their use of ExpressionBuilder
- ClosureExpressionVisitorTest.php in lib/
doctrine/ collections/ tests/ Doctrine/ Tests/ Common/ Collections/ ClosureExpressionVisitorTest.php - ExpressionBuilderTest.php in lib/
doctrine/ collections/ tests/ Doctrine/ Tests/ Common/ Collections/ ExpressionBuilderTest.php
File
- lib/
doctrine/ collections/ lib/ Doctrine/ Common/ Collections/ ExpressionBuilder.php, line 36
Namespace
Doctrine\Common\CollectionsView source
class ExpressionBuilder {
/**
* @param mixed $x
*
* @return CompositeExpression
*/
public function andX($x = null) {
return new CompositeExpression(CompositeExpression::TYPE_AND, func_get_args());
}
/**
* @param mixed $x
*
* @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
*
* @return Comparison
*/
public function isNull($field) {
return new Comparison($field, Comparison::EQ, new Value(null));
}
/**
* @param string $field
* @param mixed $values
*
* @return Comparison
*/
public function in($field, array $values) {
return new Comparison($field, Comparison::IN, new Value($values));
}
/**
* @param string $field
* @param mixed $values
*
* @return Comparison
*/
public function notIn($field, array $values) {
return new Comparison($field, Comparison::NIN, new Value($values));
}
/**
* @param string $field
* @param mixed $value
*
* @return Comparison
*/
public function contains($field, $value) {
return new Comparison($field, Comparison::CONTAINS, new Value($value));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ExpressionBuilder:: |
public | function | ||
ExpressionBuilder:: |
public | function | ||
ExpressionBuilder:: |
public | function | ||
ExpressionBuilder:: |
public | function | ||
ExpressionBuilder:: |
public | function | ||
ExpressionBuilder:: |
public | function | ||
ExpressionBuilder:: |
public | function | ||
ExpressionBuilder:: |
public | function | ||
ExpressionBuilder:: |
public | function | ||
ExpressionBuilder:: |
public | function | ||
ExpressionBuilder:: |
public | function | ||
ExpressionBuilder:: |
public | function |