/** * @return bool */ public function myPostsDelete($id, User $user) { $post = $this->repository->find($id); if (!$post || $post->getUser()->getId() != $user->getId()) { return false; } return $this->repository->delete($post); }