public function addNewNotification() { $manager = $this->em; $notification = new Notification(); $notification->setSubject($this->subject); $notification->setBody($this->body); $notification->setUser($this->user); $manager->persist($notification); $manager->flush(); return new Response('notification id ' . $notification->getId() . ' successfully created'); }