Exemplo n.º 1
0
 /**
  * {@inheritDoc}
  *
  * @throws Exception\InvalidQueryException
  */
 public function execute($sql)
 {
     if (!$this->isConnected()) {
         $this->connect();
     }
     if ($this->profiler) {
         $this->profiler->profilerStart($sql);
     }
     $resultResource = $this->resource->query($sql);
     if ($this->profiler) {
         $this->profiler->profilerFinish($sql);
     }
     // if the returnValue is something other than a mysqli_result, bypass wrapping it
     if ($resultResource === false) {
         throw new Exception\InvalidQueryException($this->resource->error);
     }
     $resultPrototype = $this->driver->createResult($resultResource === true ? $this->resource : $resultResource);
     return $resultPrototype;
 }
Exemplo n.º 2
0
 /**
  * Execute
  *
  * @param null|array|ParameterContainer $parameters
  * @throws Exception\RuntimeException
  * @return mixed
  */
 public function execute($parameters = null)
 {
     if (!$this->isPrepared) {
         $this->prepare();
     }
     /** START Standard ParameterContainer Merging Block */
     if (!$this->parameterContainer instanceof ParameterContainer) {
         if ($parameters instanceof ParameterContainer) {
             $this->parameterContainer = $parameters;
             $parameters = null;
         } else {
             $this->parameterContainer = new ParameterContainer();
         }
     }
     if (is_array($parameters)) {
         $this->parameterContainer->setFromArray($parameters);
     }
     /** END Standard ParameterContainer Merging Block */
     if ($this->profiler) {
         $this->profiler->profilerStart($this);
     }
     $args = $this->parameterContainer->getPositionalArray();
     $argArray = [$this->resource];
     if (!empty($args)) {
         $argArray = array_merge($argArray, $args);
     }
     //die(var_dump($argArray));
     $response = call_user_func_array('ibase_execute', $argArray);
     if ($this->profiler) {
         $this->profiler->profilerFinish();
     }
     if ($response === false) {
         throw new Exception\RuntimeException(ibase_errmsg());
     }
     $result = $this->driver->createResult($response);
     return $result;
 }