buildSelectQuery() public méthode

Returns SQL query.
public buildSelectQuery ( $columns = NULL ) : string
Résultat string
Exemple #1
0
 protected function execute()
 {
     if ($this->rows !== NULL) {
         return;
     }
     $this->observeCache = TRUE;
     try {
         $result = $this->query($this->sqlBuilder->buildSelectQuery());
     } catch (\PDOException $exception) {
         if (!$this->sqlBuilder->getSelect() && $this->prevAccessed) {
             $this->prevAccessed = '';
             $this->accessed = array();
             $result = $this->query($this->sqlBuilder->buildSelectQuery());
         } else {
             throw $exception;
         }
     }
     $this->rows = array();
     $result->setFetchMode(PDO::FETCH_ASSOC);
     foreach ($result as $key => $row) {
         $row = $result->normalizeRow($row);
         $this->rows[isset($row[$this->primary]) ? $row[$this->primary] : $key] = $this->createRow($row);
     }
     $this->data = $this->rows;
     if (isset($row[$this->primary]) && !is_string($this->accessed)) {
         $this->accessed[$this->primary] = TRUE;
     }
 }
Exemple #2
0
 /**
  * @return string
  */
 public function getSql()
 {
     return $this->sqlBuilder->buildSelectQuery($this->getPreviousAccessedColumns());
 }
 /**
  * @return string
  */
 public function getSql()
 {
     return $this->sqlBuilder->buildSelectQuery();
 }