Pagekit\Database\Query\QueryBuilder::execute PHP Method

execute() public method

Execute the "select" query.
public execute ( mixed $columns = ['*'] ) : Doctrine\DBAL\Driver\Statement
$columns mixed
return Doctrine\DBAL\Driver\Statement
    public function execute($columns = ['*'])
    {
        if (empty($this->parts['select'])) {
            $this->select($columns);
        }
        return $this->executeQuery();
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Execute the query and get all results.
  *
  * @return array
  */
 public function get()
 {
     if ($entities = $this->manager->hydrateAll($this->query->execute(), $this->metadata)) {
         foreach ($this->getRelations() as $name => $query) {
             $this->manager->related($entities, $name, $query);
         }
     }
     return $entities;
 }