Example #1
0
 /**
  * @expectedException b2\Exception
  * @expectedExceptionMessage Empty WHERE
  */
 public function testEmpty()
 {
     $where = new Where();
     $where->toString($this->quoter());
 }
Example #2
0
 /**
  *
  * @param mixed $type
  * @param Literal|string $table
  * @param mixed $condition
  * @return $this
  * @throws Exception
  */
 private function join($type, $table, $condition)
 {
     $tableExpression = null;
     if ($table instanceof Literal) {
         $tableExpression = $table;
     } elseif (is_string($table)) {
         $tableExpression = new Identifier($table);
     } else {
         throw new Exception('Table name or Literal expected');
     }
     $condArgs = array_slice(func_get_args(), 2);
     $joinCondition = WhereUpdateCommon::extractExpressions($condArgs);
     $where = new Where();
     foreach ($joinCondition as $jc) {
         $where->addAnd($jc);
     }
     $info = new JoinInfo($type, $tableExpression, $where->getExpression());
     $this->joins[] = $info;
     return $this;
 }