예제 #1
0
 /**
  * @inheritdoc
  */
 public function whereExists(ICmdSelect $select, $negate = false)
 {
     $in = $select->assemble();
     $statement = $negate ? 'NOT EXISTS' : 'EXISTS';
     return $this->where("{$statement} ({$in})", $select->bind());
 }
예제 #2
0
 /**
  * Use select command to insert into the table. 
  * Note that in this case no values can be bind to the table.
  * @param ICmdSelect $select Select sub query used to retrieve the insert values.
  * @return static
  */
 public function asSelect(ICmdSelect $select)
 {
     $this->setPart(CmdInsert::PART_VALUES, false);
     return $this->setPart(CmdInsert::PART_AS, $select->assemble(), $select->bind());
 }
예제 #3
0
 /**
  * @param ICmdSelect $select
  * @param bool $all
  * @return static
  */
 public function union(ICmdSelect $select, $all = false)
 {
     $union = 'UNION ' . ($all ? 'ALL ' : '');
     return $this->appendPart(CmdSelect::PART_UNION, $union . "({$select->assemble()})", $select->bind());
 }