/** * {@inheritdoc} */ public function remove($data, $flush = true) { $entity = null; if (is_object($data)) { $entity = $data; } elseif (is_numeric($data)) { $entity = $this->source->findOneById($data); } else { throw new \InvalidArgumentException('Argument passed is not an object or it\'s id'); } if ($this->crudManager instanceof CrudManagerInterface) { $this->crudManager->remove($entity); } else { $this->entityManager->remove($entity); } if ($flush) { $this->entityManager->flush(); } }
/** * @param $id * @return mixed */ public function getUserById($id) { return $this->userRepository->findOneById($id); }
public function getOneById($id) { return parent::findOneById($id); }
/** * {@inheritdoc} */ public function find($id) { return $this->repository->findOneById($id); }