Inheritance: extends BaseQuery
コード例 #1
0
ファイル: SelectQuery.php プロジェクト: peter23/fluentpdo
 protected function buildQuery()
 {
     if (!isset($this->statements['SELECT']) || !$this->statements['SELECT']) {
         $this->statements['SELECT'][] = $this->fromAlias . '.*';
     }
     return parent::buildQuery();
 }
コード例 #2
0
ファイル: DeleteQuery.php プロジェクト: otkinlife/MyPhalcon
 /** Execute DELETE query
  * @return boolean
  */
 public function execute()
 {
     $result = parent::execute();
     if ($result) {
         return $result->rowCount();
     }
     return false;
 }
コード例 #3
0
ファイル: DeleteQuery.php プロジェクト: vitordm/VTRORM
 public function parse()
 {
     $this->sql = "DELETE ";
     $this->sql .= $this->parseFrom()->from;
     //WHERE
     $this->sql = $this->concatValues($this->sql, $this->parseWhere()->where);
     parent::parse();
     return $this->sql;
 }
コード例 #4
0
ファイル: UpdateQuery.php プロジェクト: fpdo/fluentpdo
 /**
  * Execute update query
  *
  * @param boolean $getResultAsPdoStatement true to return the pdo statement instead of row count
  *
  * @return int|boolean|\PDOStatement
  */
 public function execute($getResultAsPdoStatement = false)
 {
     $result = parent::execute();
     if ($getResultAsPdoStatement) {
         return $result;
     }
     if ($result) {
         return $result->rowCount();
     }
     return false;
 }
コード例 #5
0
ファイル: SelectQuery.php プロジェクト: itillawarra/cmfive
 function __construct(FluentPDO $fpdo, $from)
 {
     $clauses = array('SELECT' => ', ', 'FROM' => null, 'JOIN' => array($this, 'getClauseJoin'), 'WHERE' => ' AND ', 'GROUP BY' => ',', 'HAVING' => ' AND ', 'ORDER BY' => ', ', 'LIMIT' => null, 'OFFSET' => null, "\n--" => "\n--");
     parent::__construct($fpdo, $clauses);
     # initialize statements
     $fromParts = explode(' ', $from);
     $this->fromTable = reset($fromParts);
     $this->fromAlias = end($fromParts);
     $this->statements['FROM'] = $from;
     $this->statements['SELECT'][] = $this->fromAlias . '.*';
     $this->joins[] = $this->fromAlias;
 }