/** * 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()]); }
/** * @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); }