public function testMergeWhere() { $this->queryBuilder->where('id', 5, SelectQueryBuilder::LESS_THAN); $qb = new SelectQueryBuilder(); $qb->_open(SelectQueryBuilder::LOGICAL_OR)->where('title', 'Dune', SelectQueryBuilder::NOT_EQUALS, null)->_close(); $this->queryBuilder->mergeWhere($qb); $expected = array(array('column' => 'id', 'value' => 5, 'operator' => '<', 'connector' => 'AND'), array('bracket' => '(', 'connector' => 'OR'), array('column' => 'title', 'value' => 'Dune', 'operator' => '!=', 'connector' => 'AND'), array('bracket' => ')', 'connector' => NULL)); $this->assertEquals($expected, $this->queryBuilder->getWhereParts()); }
/** * Merges the given QueryBuilder's WHEREs into this QueryBuilder. * * @param \SQL\Base\WhereQueryBuilder $QueryBuilder to merge * * @return \SQL\DeleteQueryBuilder the current QueryBuilder */ public function mergeWhere(WhereQueryBuilder $QueryBuilder) { return parent::mergeWhere($QueryBuilder); }