Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ($form->isValid()) {
- $em = $this->getDoctrine()->getManager();
- $bookEntity = $em->getRepository("AppBundle:book")->findBy(array("date" => $req->getDate()));
- if (count($bookEntity) == 0) {
- $em->persist($req);
- $em->flush();
- return $this->redirectToRoute("homepage");
- }elseif(count($bookEntity) == 1){
- // return new Response ('Er is al iets gepland');
- echo "Error";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment