コード例 #1
0
ファイル: PdoStorage.php プロジェクト: fixin/fixin
 /**
  * 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]);
 }
コード例 #2
0
ファイル: GrammarBase.php プロジェクト: fixin/fixin
 /**
  * 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();
 }
コード例 #3
0
ファイル: Grammar.php プロジェクト: fixin/fixin
 /**
  * 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));
     }
 }