DB_dsql::execute PHP Méthode

execute() public méthode

Executes current query.
public execute ( )
    public function execute()
    {
        try {
            /**/
            $this->app->pr->start('dsql/execute/render');
            $q = $this->render();
            /**/
            $this->app->pr->next('dsql/execute/query');
            $this->stmt = $this->owner->query($q, $this->params);
            $this->template = $this->mode = null;
            /**/
            $this->app->pr->stop();
            return $this;
        } catch (PDOException $e) {
            throw $this->exception('Database Query Failed')->addMoreInfo('pdo_error', $e->getMessage())->addMoreInfo('mode', $this->mode)->addMoreInfo('params', $this->params)->addMoreInfo('query', $q)->addMoreInfo('template', $this->template);
        }
    }

Usage Example

Exemple #1
0
 public function execute()
 {
     if (empty($this->args['fields'])) {
         $this->args['fields'] = array('*');
     }
     return parent::execute();
 }