Exemplo n.º 1
0
 /**
  * Query
  *
  * @param QueryInterface $query
  * @param array $mode
  * @return StorageResultInterface
  */
 protected function query(QueryInterface $query, array $mode) : StorageResultInterface
 {
     $statement = $this->resource->prepare($query->getText());
     call_user_func_array([$statement, 'setFetchMode'], $mode);
     $statement->execute($query->getParameters());
     return $this->container->clonePrototype(static::PROTOTYPE_STORAGE_RESULT, [PdoStorageResult::OPTION_STATEMENT => $statement]);
 }
Exemplo n.º 2
0
 /**
  * Request string
  *
  * @param RequestInterface $request
  * @param QueryInterface $query
  * @return string
  */
 protected function requestToString(RequestInterface $request, QueryInterface $query) : string
 {
     $selectQuery = $this->select($request);
     $query->addParameters($selectQuery->getParameters());
     return $selectQuery->getText();
 }
Exemplo n.º 3
0
 /**
  * WHERE clause
  *
  * @param RequestInterface $request
  * @param QueryInterface $query
  */
 protected function clauseWhere(RequestInterface $request, QueryInterface $query)
 {
     if ($request->hasWhere()) {
         $query->appendString($this->whereToString(static::CLAUSE_WHERE, $request->getWhere(), $query));
     }
 }