/** * Resolve additional relations * * @param QueryBuilder $query * @param array $targets */ protected function resolveRelations(QueryBuilder $query, $targets) { if (!$targets) { return; } foreach ($query->getRelations() as $name => $q) { $this->manager->related($targets, $name, $q); } }
/** * Removes an entity. * * @param object $entity * @throws \InvalidArgumentException * @return bool */ public function remove($entity) { $metadata = $this->manager->getMetadata($entity); $class = $metadata->getClass(); $id = $this->getIdentifier($entity); if ($id === '') { throw new \InvalidArgumentException(sprintf('The entity of class %s is missing an identifier.', $class)); } unset($this->identifiers[spl_object_hash($entity)]); if (isset($this->entities[$class][$id])) { unset($this->entities[$class][$id]); return true; } return false; }
/** * Returns the database connection for this event. * * @return Connection */ public function getConnection() { return $this->manager->getConnection(); }
/** * Deletes an entity. * * @param object $entity */ public function delete($entity) { $this->manager->delete($entity); }