/** * Executes a $query against OrientDB. * This method should be used to executes query which should not return a * result (UPDATE, INSERT) or to retrieve multiple objects: to retrieve a * single record look at ->find*() methods. * * @param Query $query * @return Array */ public function execute(Query $query) { $adapter = $this->getProtocolAdapter(); $return = $query->shouldReturn(); $execution = $adapter->execute($query->getRaw(), $return); $results = $adapter->getResult(); if ($execution) { if (is_array($results)) { $hydrationResults = $this->getMapper()->hydrateCollection($results); return $this->finalizeCollection($hydrationResults); } return true; } return false; }