Пример #1
0
 public function where(...$expressions)
 {
     /**
      * @var $this IStatement
      */
     $where = WhereClause::create($expressions);
     $this->addClause($where);
     return $this;
 }
Пример #2
0
 public function testNullBuilder()
 {
     $this->assertEquals("WHERE name IS NULL AND description IS NOT NULL", QueryAssembler::stringify(WhereClause::create(['name' => null, 'NOT' => ['description' => null]])));
 }
Пример #3
0
 public function testNoPredicates()
 {
     $where = WhereClause::create();
     $where->addPredicate(new PredicateSet());
     $this->assertEquals('WHERE ', CqlAssembler::stringify($where));
 }
Пример #4
0
 public function testInPredicate()
 {
     $this->assertEquals('WHERE field1 IN ("value1","value2")', QueryAssembler::stringify(WhereClause::create(['field1' => ['value1', 'value2']])));
     $this->setExpectedException('\\Packaged\\QueryBuilder\\Exceptions\\Assembler\\QueryBuilderAssemblerException', 'Cannot assemble an empty ArrayExpression');
     QueryAssembler::stringify(WhereClause::create(['field1' => []]));
 }