public function authenticateUser(UserInterface $user, Response $response) { parent::authenticateUser($user, $response); $em = $this->container->get('doctrine')->getManager(); $book = new AddressBook($user); $em->persist($book); $em->flush(); }