コード例 #1
0
 /**
  * @return string
  */
 public function prepareExists()
 {
     $columns = empty($this->_columns) ? '*' : implode(', ', $this->_columns);
     $tables = implode(', ', $this->_tables);
     $where = empty($this->_where) ? '' : ' WHERE ' . $this->_where->prepare();
     $having = empty($this->_having) ? '' : ' HAVING ' . $this->_having->prepare();
     $join = empty($this->_join) ? '' : ' ' . $this->_join->prepare();
     $limit = ' LIMIT 0, 1';
     $group = empty($this->_group) ? '' : ' GROUP BY ' . $this->_group;
     return 'SELECT ' . $columns . ' FROM ' . $tables . $join . $where . $group . $having . $limit;
 }
コード例 #2
0
 /**
  * @param SelectQuerySource $source source to which join operation should be applied
  * @param SqlJoinMethod $joinMethod method to use when performing join
  * @param SqlFieldArray $identicalColumns set of column names that should be used in joining
  */
 function __construct(SelectQuerySource $source, SqlJoinMethod $joinMethod, SqlFieldArray $identicalColumns)
 {
     $this->identicalColumns = $identicalColumns;
     parent::__construct($source, $joinMethod);
 }
コード例 #3
0
 /**
  * @param SelectQuerySource $source source to which join operation should be applied
  * @param SqlJoinMethod $joinMethod method to use when performing join
  * @param IExpression $condition condition to use when performing join
  */
 function __construct(SelectQuerySource $source, SqlJoinMethod $joinMethod, IExpression $condition)
 {
     $this->condition = $condition;
     parent::__construct($source, $joinMethod);
 }