public function delete(User $user) { if ($this->auth->getIdentity() == $user->getId()) { throw new \InvalidArgumentException("You can't delete yourself"); } $this->getRepository()->delete($user); }