getConjuncts() 공개 메소드

Returns the conjuncts of the conjunction.
public getConjuncts ( ) : Webmozart\Expression\Expression[]
리턴 Webmozart\Expression\Expression[] The conjuncts.
예제 #1
0
 /**
  * @dataProvider \Webmozart\Expression\Tests\ExprTest::getMethodTests
  */
 public function testAnd($method, $args, $expected)
 {
     // tested separately
     if ('true' === $method || 'false' === $method) {
         return;
     }
     if ('is' === substr($method, 0, 2)) {
         $method = substr($method, 2);
     }
     $method = 'and' . ucfirst($method);
     $conjunction1 = new AndX();
     $conjunction2 = call_user_func_array(array($conjunction1, $method), $args);
     $this->assertEquals(array(), $conjunction1->getConjuncts());
     $this->assertEquals(array($expected), $conjunction2->getConjuncts());
 }
예제 #2
0
 private function traverseConjunction(AndX $expr)
 {
     $conjuncts1 = $expr->getConjuncts();
     $conjuncts2 = array();
     foreach ($conjuncts1 as $conjunct) {
         if ($conjunct = $this->traverse($conjunct)) {
             $conjuncts2[] = $conjunct;
         }
     }
     if ($conjuncts1 === $conjuncts2) {
         return $expr;
     }
     return $conjuncts2 ? new AndX($conjuncts2) : null;
 }