buildSelectQuery() public method

Returns SQL query.
public buildSelectQuery ( $columns = NULL ) : string
return string
Ejemplo n.º 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;
     }
 }
Ejemplo n.º 2
0
 /**
  * @return string
  */
 public function getSql()
 {
     return $this->sqlBuilder->buildSelectQuery($this->getPreviousAccessedColumns());
 }
Ejemplo n.º 3
0
 /**
  * @return string
  */
 public function getSql()
 {
     return $this->sqlBuilder->buildSelectQuery();
 }