public function testCond() { $if = new Expr(); $if->gte('$field', 5); $expr = new Expr(); $this->assertSame($expr, $expr->cond($if, '$field', '$otherField')); $this->assertSame(array('$cond' => array('if' => array('$gte' => array('$field', 5)), 'then' => '$field', 'else' => '$otherField')), $expr->getExpression()); }
/** * Compares two values and returns: * true when the first value is greater than or equivalent to the second value. * false when the first value is less than the second value. * * @see http://docs.mongodb.org/manual/reference/operator/aggregation/gte/ * @see Expr::gte * @param mixed|Expr $expression1 * @param mixed|Expr $expression2 * @return self */ public function gte($expression1, $expression2) { $this->expr->gte($expression1, $expression2); return $this; }