コード例 #1
0
 /**
  * Construct a new SQLSelect.
  *
  * @param array|string $select An array of SELECT fields.
  * @param array|string $from An array of FROM clauses. The first one should be just the table name.
  * Each should be ANSI quoted.
  * @param array $where An array of WHERE clauses.
  * @param array $orderby An array ORDER BY clause.
  * @param array $groupby An array of GROUP BY clauses.
  * @param array $having An array of HAVING clauses.
  * @param array|string $limit A LIMIT clause or array with limit and offset keys
  */
 public function __construct($select = "*", $from = array(), $where = array(), $orderby = array(), $groupby = array(), $having = array(), $limit = array())
 {
     parent::__construct($from, $where);
     $this->setSelect($select);
     $this->setOrderBy($orderby);
     $this->setGroupBy($groupby);
     $this->setHaving($having);
     $this->setLimit($limit);
 }
コード例 #2
0
 /**
  * Returns the WHERE clauses ready for inserting into a query.
  *
  * @param SQLExpression $query The expression object to build from
  * @param array $parameters Out parameter for the resulting query parameters
  * @return string Completed where condition
  */
 public function buildWhereFragment(SQLConditionalExpression $query, array &$parameters)
 {
     // Get parameterised elements
     $where = $query->getWhereParameterised($whereParameters);
     if (empty($where)) {
         return '';
     }
     // Join conditions
     $connective = $query->getConnective();
     $parameters = array_merge($parameters, $whereParameters);
     $nl = $this->getSeparator();
     return "{$nl}WHERE (" . implode("){$nl}{$connective} (", $where) . ")";
 }
コード例 #3
0
 /**
  * Construct a new SQLDelete.
  *
  * @param array|string $from An array of Tables (FROM clauses). The first one should be just the table name.
  * Each should be ANSI quoted.
  * @param array $where An array of WHERE clauses.
  * @param array|string $delete The table(s) to delete, if multiple tables are queried from
  */
 function __construct($from = array(), $where = array(), $delete = array())
 {
     parent::__construct($from, $where);
     $this->setDelete($delete);
 }
コード例 #4
0
 public function isEmpty()
 {
     return empty($this->assignment) || $this->assignment->isEmpty() || parent::isEmpty();
 }