acl_gen = $acl_gen; parent::__construct($menu_gen); } public function incomingForm() { $this->denyAccessUnlessGranted('jo_in.list', null, 'No access.'); $params = $this->initParameters('jo_in'); $params['obj'] = new JobOrder(); $params['mode'] = 'create'; $em = $this->getDoctrine()->getManager(); // get parent associations $params['bmfgs'] = $em->getRepository(BatteryManufacturer::class)->findAll(); $params['customers'] = $em->getRepository(Customer::class)->findAll(); $params['outlet'] = $em->getRepository(Outlet::class)->findAll(); $params['rider'] = $em->getRepository(Rider::class)->findAll(); $params['service_types'] = ServiceType::getCollection(); $params['statuses'] = JOStatus::getCollection(); // response return $this->render('job-order/incoming.html.twig', $params); } public function incomingSubmit(Request $req) { $this->denyAccessUnlessGranted('jo_in.list', null, 'No access.'); // create new row $em = $this->getDoctrine()->getManager(); $row = new JobOrder(); // TODO: Validation, handling of job order // DEBUG: Get all variables error_log(print_r($req->request->all(), true)); // DEBUG: Fake error array $error_array = []; // DEBUG: Error response for now return $this->json([ 'success' => false, 'errors' => $error_array ], 422); } }