Пример #1
0
 /**
  * Execute the query as select, update or delete.
  *
  * @param  string $type
  * @return mixed
  */
 protected function executeQuery($type = 'select')
 {
     switch ($type) {
         case 'update':
             $sql = $this->getSQLForUpdate();
             break;
         case 'delete':
             $sql = $this->getSQLForDelete();
             break;
         default:
             $sql = $this->getSQLForSelect();
             break;
     }
     if ($type == 'select') {
         return $this->connection->executeQuery($sql, $this->params, $this->guessParamTypes($this->params));
     } else {
         return $this->connection->executeUpdate($sql, $this->params, $this->guessParamTypes($this->params));
     }
 }