当前位置: 首页>>代码示例>>PHP>>正文


PHP Expression::andBlock方法代码示例

本文整理汇总了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;
 }
开发者ID:onphp-framework,项目名称:onphp-framework,代码行数:12,代码来源:LogicUtils.class.php

示例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();
 }
开发者ID:rero26,项目名称:onphp-framework,代码行数:11,代码来源:Criteria.class.php

示例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));
 }
开发者ID:onphp-framework,项目名称:onphp-framework,代码行数:14,代码来源:LogicTest.class.php


注:本文中的Expression::andBlock方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。