예제 #1
0
파일: Query.php 프로젝트: bazo/php-orientdb
 /**
  * Create an OrientDB query instance from this query.
  *
  * @return Command The orient query type instance.
  */
 public function prepare()
 {
     return Command::fromConfig(['text' => $this->getText(), 'params' => $this->getParams()]);
 }
예제 #2
0
 /**
  * @param string $query The query text.
  * @param array $params The query parameters.
  *
  * @return ResultList The result of the query
  */
 public function query($query, array $params = [])
 {
     if (!is_object($query)) {
         $query = Command::fromConfig(['text' => $query, 'params' => $params]);
     } else {
         if ($query instanceof Query) {
             $query = $query->prepare();
         }
     }
     $results = $this->execute('command', ['query' => $query]);
     if (!is_array($results)) {
         $results = [$results];
     }
     return new ResultList($this, $results);
 }