X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=vendor%2Fdoctrine%2Fcommon%2Flib%2FDoctrine%2FCommon%2FCollections%2FExpr%2FComparison.php;fp=vendor%2Fdoctrine%2Fcommon%2Flib%2FDoctrine%2FCommon%2FCollections%2FExpr%2FComparison.php;h=29cfcffa2cb6411c323b65d55811e1221999da42;hb=8b04b2d11798dee4f3e1358e4f43e97a6df851f6;hp=0000000000000000000000000000000000000000;hpb=73568cf05a785a45f94ca3f2351d9e07bf917958;p=zf2.biz%2Fapplication_blanche.git diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/Comparison.php b/vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/Comparison.php new file mode 100644 index 0000000..29cfcff --- /dev/null +++ b/vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/Comparison.php @@ -0,0 +1,75 @@ +. + */ + +namespace Doctrine\Common\Collections\Expr; + +/** + * Comparison of a field with a value by the given operator. + * + * @author Benjamin Eberlei + * @since 2.3 + */ +class Comparison implements Expression +{ + const EQ = '='; + const NEQ = '<>'; + const LT = '<'; + const LTE = '<='; + const GT = '>'; + const GTE = '>='; + const IS = 'IS'; + const IN = 'IN'; + const NIN = 'NIN'; + + private $field; + private $op; + private $value; + + public function __construct($field, $operator, $value) + { + if ( ! ($value instanceof Value)) { + $value = new Value($value); + } + + $this->field = $field; + $this->op = $operator; + $this->value = $value; + } + + public function getField() + { + return $this->field; + } + + public function getValue() + { + return $this->value; + } + + public function getOperator() + { + return $this->op; + } + + public function visit(ExpressionVisitor $visitor) + { + return $visitor->walkComparison($this); + } +} +