本文整理汇总了PHP中Expression::andBlock方法的典型用法代码示例。如果您正苦于以下问题:PHP Expression::andBlock方法的具体用法?PHP Expression::andBlock怎么用?PHP Expression::andBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Expression
的用法示例。
在下文中一共展示了Expression::andBlock方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOpenPoint
/**
* @throws WrongArgumentException
* @return LogicalChain
**/
public static function getOpenPoint($left, $right, $point)
{
Assert::isFalse($point === null, 'how can i build logic from emptyness?');
$point = new DBValue($point);
$chain = new LogicalChain();
$chain->expOr(Expression::orBlock(Expression::andBlock(Expression::notNull($left), Expression::notNull($right), Expression::between($point, $left, $right)), Expression::andBlock(Expression::isNull($left), Expression::ltEq($point, $right)), Expression::andBlock(Expression::isNull($right), Expression::ltEq($left, $point)), Expression::andBlock(Expression::isNull($left), Expression::isNull($right))));
return $chain;
}
示例2: __construct
public function __construct($dao = null)
{
if ($dao) {
Assert::isTrue($dao instanceof ProtoDAO);
}
$this->dao = $dao;
$this->logic = Expression::andBlock();
$this->order = new OrderChain();
$this->strategy = FetchStrategy::join();
$this->projection = Projection::chain();
}
示例3: testFormCalculation
public function testFormCalculation()
{
$form = Form::create()->add(Primitive::string('a'))->add(Primitive::boolean('b'))->add(Primitive::integer('c'))->add(Primitive::integer('d'))->add(Primitive::integer('e'))->add(Primitive::boolean('f'))->import(array('a' => 'asDfg', 'b' => 'true', 'c' => '1', 'd' => '2', 'e' => '3'));
$this->assertTrue(Expression::isTrue(new FormField('b'))->toBoolean($form));
$this->assertFalse(Expression::isTrue(new FormField('f'))->toBoolean($form));
$this->assertFalse(Expression::eq('asdf', new FormField('a'))->toBoolean($form));
$this->assertTrue(Expression::eqLower('asdfg', new FormField('a'))->toBoolean($form));
$this->assertTrue(Expression::eq('asDfg', new FormField('a'))->toBoolean($form));
$this->assertTrue(Expression::andBlock(Expression::expOr(new FormField('b'), new FormField('f')), Expression::eq(7, Expression::add(new FormField('c'), Expression::mul(new FormField('d'), new FormField('e')))))->toBoolean($form));
$this->assertTrue(Expression::between(new FormField('d'), new FormField('c'), new FormField('e'))->toBoolean($form));
$this->assertFalse(Expression::between(new FormField('c'), new FormField('d'), new FormField('e'))->toBoolean($form));
$this->assertFalse(Expression::not(new FormField('b'))->toBoolean($form));
$this->assertTrue(Expression::not(new FormField('f'))->toBoolean($form));
}