本文整理汇总了PHP中Webmozart\Expression\Expr::andX方法的典型用法代码示例。如果您正苦于以下问题:PHP Expr::andX方法的具体用法?PHP Expr::andX怎么用?PHP Expr::andX使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Webmozart\Expression\Expr
的用法示例。
在下文中一共展示了Expr::andX方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testDomainExpressions
public function testDomainExpressions()
{
$c1 = new Customer();
$c1->setPremium(true);
$c2 = new Customer();
$c2->setBookings(array('booking1', 'booking2'));
$c3 = new Customer();
$c3->setPremium(true);
$c3->setBookings(array('booking1'));
$customers = array($c1, $c2, $c3);
$this->assertEquals(array($c1, 2 => $c3), Expr::filter($customers, new IsPremium()));
$this->assertEquals(array(1 => $c2, 2 => $c3), Expr::filter($customers, new HasPreviousBookings()));
$this->assertEquals(array(2 => $c3), Expr::filter($customers, Expr::andX(array(new HasPreviousBookings(), new IsPremium()))));
}
示例2: testAndX
public function testAndX()
{
$andX = new AndX(array(new GreaterThan(5), new LessThan(10)));
$this->assertEquals($andX, Expr::andX(array(Expr::greaterThan(5), Expr::lessThan(10))));
}