public function createPost(Request $request, Response $response) { $title = $request->getParam('title'); $content = $request->getParam('content'); $slug = trim($title); $slug = str_replace(' ', '-', $slug); $post = new Post(); $post->setTitle($title); $post->setContent($content); $post->setSlug($slug); $this->em->persist($post); $this->em->flush(); echo "Da them bai viet moi thanh cong"; }
public function __invoke(Request $req, Response $res, $args = []) { $vaultName = $args['vaultName']; if (!($vault = Vault::get($vaultName))) { return $res->withStatus(404); } $operation = $req->getParam('operation'); $postData = file_get_contents('php://input'); $params = json_decode($postData, true); try { if ($operation === 'add') { if (empty($params['Tags'])) { return $res->withStatus(400); } $vault->addTags($params['Tags']); return $res->withStatus(204); } elseif ($operation === 'remove') { if (empty($params['TagKeys'])) { return $res->withStatus(204); } $vault->removeTags($params['TagKeys']); return $res->withStatus(204); } return $res->withStatus(400); } catch (\Gsandbox\Model\LimitExceededException $e) { return $res->limitExceededException(); } }
public function signinUser(Request $request, Response $response) { $username = $request->getParam('username'); $password = $request->getParam('password'); $u = $this->em->getRepository('App\\Model\\User')->findOneBy(array('username' => $username)); if ($u == []) { echo "Username nay khong ton tai"; } else { if ($u->getPassword() != $password) { echo "Ban nhap sai password"; } else { echo "Ban da dang nhap thanh cong"; } } return $response; }
public function __invoke(ServerRequestInterface $requestInterface, ResponseInterface $responseInterface, callable $next) { $valid = $this->verify($requestInterface->getParam('g-recaptcha-response'), $requestInterface->getServerParams()['REMOTE_ADDR']); if ($valid) { return $next($requestInterface, $responseInterface); } else { throw new \Exception("Captcha Failed"); } }
public function authenticate(ServerRequestInterface $request, ResponseInterface $response) { if (empty($username = $request->getParam('username')) || empty($password = $request->getParam('password')) || empty($grant = $request->getParam('grant_type')) || $grant !== 'password') { throw (new OAuth2Exception('Invalid parameters supplied for authentication'))->displayMessage(OAuth2Exception::BAD_CREDENTIALS)->response($response->withStatus(401)); } $result = $this->authRepo->validateCredentials($username, $password); if (empty($result)) { throw (new OAuth2Exception('Wrong username or password'))->displayMessage(OAuth2Exception::BAD_CREDENTIALS)->response($response->withStatus(401)); } $address = $this->getAddress(); $expiration = $this->getExpiration($this->config['expiration']); $builder = (new Builder())->setIssuer($address)->setAudience($address)->setId(md5(uniqid(mt_rand(), true)), true)->setIssuedAt(time())->setNotBefore(time() + 60)->setExpiration($expiration)->setSubject($result['id']); $customClaims = []; foreach ($result as $claim => $value) { if ($claim !== 'id') { $customClaims[] = $claim; $builder->set($claim, $value); } } $token = $builder->set('cc', implode(',', $customClaims))->sign(new Sha256(), new Key($this->config['private-key']))->getToken(); // Retrieves the generated token return $response->withHeader(\HTTP\Header\CacheControl::name(), \HTTP\Header\CacheControl::values([\HTTP\Header\CacheControl::NO_CACHE, \HTTP\Header\CacheControl::REVALIDATE]))->writeJson(['token' => sprintf('%s', $token), 'type' => 'Bearer', 'expires' => $expiration]); }
public function edit(Request $request, Response $response, $args) { $kpi_entity = $this->em->getRepository('App\\Entity\\Kpi')->findOneById($args['id']); $kpi_type_comparative_entity = $this->em->getRepository('App\\Entity\\KpiType')->findOneById(1); $kpi_type_budgeted_entity = $this->em->getRepository('App\\Entity\\KpiType')->findOneById(2); $criteria_comparative = Criteria::create(); $criteria_comparative->where(Criteria::expr()->eq('kpi', $kpi_entity)); $criteria_comparative->andWhere(Criteria::expr()->eq('kpiType', $kpi_type_comparative_entity)); $criteria_budgeted = Criteria::create(); $criteria_budgeted->where(Criteria::expr()->eq('kpi', $kpi_entity)); $criteria_budgeted->andWhere(Criteria::expr()->eq('kpiType', $kpi_type_budgeted_entity)); $comparative_groupbenner_entity = $this->em->getRepository('App\\Entity\\GroupBenner')->matching($criteria_comparative)->first(); $comparative_healthoperators_entity = $this->em->getRepository('App\\Entity\\HealthOperators')->matching($criteria_comparative)->first(); $comparative_hospital_entity = $this->em->getRepository('App\\Entity\\Hospital')->matching($criteria_comparative)->first(); $comparative_ominousmanagement_entity = $this->em->getRepository('App\\Entity\\OminousManagement')->matching($criteria_comparative)->first(); $comparative_systems_entity = $this->em->getRepository('App\\Entity\\Systems')->matching($criteria_comparative)->first(); $budgeted_groupbenner_entity = $this->em->getRepository('App\\Entity\\GroupBenner')->matching($criteria_budgeted)->first(); $budgeted_healthoperators_entity = $this->em->getRepository('App\\Entity\\HealthOperators')->matching($criteria_budgeted)->first(); $budgeted_hospital_entity = $this->em->getRepository('App\\Entity\\Hospital')->matching($criteria_budgeted)->first(); $budgeted_ominousmanagement_entity = $this->em->getRepository('App\\Entity\\OminousManagement')->matching($criteria_budgeted)->first(); $budgeted_systems_entity = $this->em->getRepository('App\\Entity\\Systems')->matching($criteria_budgeted)->first(); $employees_entity = $this->em->getRepository('App\\Entity\\Employees')->findOneByKpi($kpi_entity); if ($request->isPost()) { $data_kpi = array('responsible' => $request->getParam('information')['responsible'], 'period_first_initial' => new \DateTime(substr($request->getParam('period')['first']['initial'], -4) . '-' . substr($request->getParam('period')['first']['initial'], 0, 2) . '-01'), 'period_first_end' => new \DateTime(substr($request->getParam('period')['first']['end'], -4) . '-' . substr($request->getParam('period')['first']['end'], 0, 2) . '-01'), 'period_second_initial' => new \DateTime(substr($request->getParam('period')['second']['initial'], -4) . '-' . substr($request->getParam('period')['second']['initial'], 0, 2) . '-01'), 'period_second_end' => new \DateTime(substr($request->getParam('period')['second']['end'], -4) . '-' . substr($request->getParam('period')['second']['end'], 0, 2) . '-01')); (new ClassMethods())->hydrate($data_kpi, $kpi_entity); $data_comparative_groupbenner = array('revenues_initial' => $request->getParam('groupbenner')[1]['revenues']['initial'], 'revenues_end' => $request->getParam('groupbenner')[1]['revenues']['end'], 'revenues_target' => $request->getParam('groupbenner')[1]['revenues']['target'], 'revenues_percentage' => $request->getParam('groupbenner')[1]['revenues']['percentage'], 'ebtida_initial' => $request->getParam('groupbenner')[1]['ebtida']['initial'], 'ebtida_end' => $request->getParam('groupbenner')[1]['ebtida']['end'], 'ebtida_target' => $request->getParam('groupbenner')[1]['ebtida']['target'], 'ebtida_percentage' => $request->getParam('groupbenner')[1]['ebtida']['percentage'], 'net_profit_initial' => $request->getParam('groupbenner')[1]['net_profit']['initial'], 'net_profit_end' => $request->getParam('groupbenner')[1]['net_profit']['end'], 'net_profit_target' => $request->getParam('groupbenner')[1]['net_profit']['target'], 'net_profit_percentage' => $request->getParam('groupbenner')[1]['net_profit']['percentage'], 'kpi_type' => $kpi_type_comparative_entity, 'kpi' => $kpi_entity); (new ClassMethods())->hydrate($data_comparative_groupbenner, $comparative_groupbenner_entity); $this->em->persist($comparative_groupbenner_entity); $this->em->flush(); $data_comparative_healthoperators = array('revenues_initial' => $request->getParam('healthoperators')[1]['revenues']['initial'], 'revenues_end' => $request->getParam('healthoperators')[1]['revenues']['end'], 'revenues_target' => $request->getParam('healthoperators')[1]['revenues']['target'], 'revenues_percentage' => $request->getParam('healthoperators')[1]['revenues']['percentage'], 'ebtida_initial' => $request->getParam('healthoperators')[1]['ebtida']['initial'], 'ebtida_end' => $request->getParam('healthoperators')[1]['ebtida']['end'], 'ebtida_target' => $request->getParam('healthoperators')[1]['ebtida']['target'], 'ebtida_percentage' => $request->getParam('healthoperators')[1]['ebtida']['percentage'], 'net_profit_initial' => $request->getParam('healthoperators')[1]['net_profit']['initial'], 'net_profit_end' => $request->getParam('healthoperators')[1]['net_profit']['end'], 'net_profit_target' => $request->getParam('healthoperators')[1]['net_profit']['target'], 'net_profit_percentage' => $request->getParam('healthoperators')[1]['net_profit']['percentage'], 'lu_value' => $request->getParam('healthoperators')[1]['lu']['value'], 'lu_percentage' => $request->getParam('healthoperators')[1]['lu']['percentage'], 'lum_value' => $request->getParam('healthoperators')[1]['lum']['value'], 'lum_percentage' => $request->getParam('healthoperators')[1]['lum']['percentage'], 'implantation_value' => $request->getParam('healthoperators')[1]['implantation']['value'], 'implantation_percentage' => $request->getParam('healthoperators')[1]['implantation']['percentage'], 'sms_value' => $request->getParam('healthoperators')[1]['sms']['value'], 'sms_percentage' => $request->getParam('healthoperators')[1]['sms']['percentage'], 'medical_services_value' => $request->getParam('healthoperators')[1]['medical_services']['value'], 'medical_services_percentage' => $request->getParam('healthoperators')[1]['medical_services']['percentage'], 'workout_value' => $request->getParam('healthoperators')[1]['workout']['value'], 'workout_percentage' => $request->getParam('healthoperators')[1]['workout']['percentage'], 'kpi_type' => $kpi_type_comparative_entity, 'kpi' => $kpi_entity); (new ClassMethods())->hydrate($data_comparative_healthoperators, $comparative_healthoperators_entity); $this->em->persist($comparative_healthoperators_entity); $this->em->flush(); $data_comparative_hospital = array('revenues_initial' => $request->getParam('hospital')[1]['revenues']['initial'], 'revenues_end' => $request->getParam('hospital')[1]['revenues']['end'], 'revenues_target' => $request->getParam('hospital')[1]['revenues']['target'], 'revenues_percentage' => $request->getParam('hospital')[1]['revenues']['percentage'], 'ebtida_initial' => $request->getParam('hospital')[1]['ebtida']['initial'], 'ebtida_end' => $request->getParam('hospital')[1]['ebtida']['end'], 'ebtida_target' => $request->getParam('hospital')[1]['ebtida']['target'], 'ebtida_percentage' => $request->getParam('hospital')[1]['ebtida']['percentage'], 'net_profit_initial' => $request->getParam('hospital')[1]['net_profit']['initial'], 'net_profit_end' => $request->getParam('hospital')[1]['net_profit']['end'], 'net_profit_target' => $request->getParam('hospital')[1]['net_profit']['target'], 'net_profit_percentage' => $request->getParam('hospital')[1]['net_profit']['percentage'], 'lu_value' => $request->getParam('hospital')[1]['lu']['value'], 'lu_percentage' => $request->getParam('hospital')[1]['lu']['percentage'], 'lum_value' => $request->getParam('hospital')[1]['lum']['value'], 'lum_percentage' => $request->getParam('hospital')[1]['lum']['percentage'], 'implantation_value' => $request->getParam('hospital')[1]['implantation']['value'], 'implantation_percentage' => $request->getParam('hospital')[1]['implantation']['percentage'], 'kpi_type' => $kpi_type_comparative_entity, 'kpi' => $kpi_entity); (new ClassMethods())->hydrate($data_comparative_hospital, $comparative_hospital_entity); $this->em->persist($comparative_hospital_entity); $this->em->flush(); $data_comparative_ominousmanagement = array('revenues_initial' => $request->getParam('ominousmanagement')[1]['revenues']['initial'], 'revenues_end' => $request->getParam('ominousmanagement')[1]['revenues']['end'], 'revenues_target' => $request->getParam('ominousmanagement')[1]['revenues']['target'], 'revenues_percentage' => $request->getParam('ominousmanagement')[1]['revenues']['percentage'], 'ebtida_initial' => $request->getParam('ominousmanagement')[1]['ebtida']['initial'], 'ebtida_end' => $request->getParam('ominousmanagement')[1]['ebtida']['end'], 'ebtida_target' => $request->getParam('ominousmanagement')[1]['ebtida']['target'], 'ebtida_percentage' => $request->getParam('ominousmanagement')[1]['ebtida']['percentage'], 'net_profit_initial' => $request->getParam('ominousmanagement')[1]['net_profit']['initial'], 'net_profit_end' => $request->getParam('ominousmanagement')[1]['net_profit']['end'], 'net_profit_target' => $request->getParam('ominousmanagement')[1]['net_profit']['target'], 'net_profit_percentage' => $request->getParam('ominousmanagement')[1]['net_profit']['percentage'], 'services_value' => $request->getParam('ominousmanagement')[1]['services']['value'], 'services_percentage' => $request->getParam('ominousmanagement')[1]['services']['percentage'], 'kpi_type' => $kpi_type_comparative_entity, 'kpi' => $kpi_entity); (new ClassMethods())->hydrate($data_comparative_ominousmanagement, $comparative_ominousmanagement_entity); $this->em->persist($comparative_ominousmanagement_entity); $this->em->flush(); $data_comparative_systems = array('revenues_initial' => $request->getParam('systems')[1]['revenues']['initial'], 'revenues_end' => $request->getParam('systems')[1]['revenues']['end'], 'revenues_target' => $request->getParam('systems')[1]['revenues']['target'], 'revenues_percentage' => $request->getParam('systems')[1]['revenues']['percentage'], 'ebtida_initial' => $request->getParam('systems')[1]['ebtida']['initial'], 'ebtida_end' => $request->getParam('systems')[1]['ebtida']['end'], 'ebtida_target' => $request->getParam('systems')[1]['ebtida']['target'], 'ebtida_percentage' => $request->getParam('systems')[1]['ebtida']['percentage'], 'net_profit_initial' => $request->getParam('systems')[1]['net_profit']['initial'], 'net_profit_end' => $request->getParam('systems')[1]['net_profit']['end'], 'net_profit_target' => $request->getParam('systems')[1]['net_profit']['target'], 'net_profit_percentage' => $request->getParam('systems')[1]['net_profit']['percentage'], 'lu_value' => $request->getParam('systems')[1]['lu']['value'], 'lu_percentage' => $request->getParam('systems')[1]['lu']['percentage'], 'lum_value' => $request->getParam('systems')[1]['lum']['value'], 'lum_percentage' => $request->getParam('systems')[1]['lum']['percentage'], 'implantation_value' => $request->getParam('systems')[1]['implantation']['value'], 'implantation_percentage' => $request->getParam('systems')[1]['implantation']['percentage'], 'sms_value' => $request->getParam('systems')[1]['sms']['value'], 'sms_percentage' => $request->getParam('systems')[1]['sms']['percentage'], 'royaltes_value' => $request->getParam('systems')[1]['royaltes']['value'], 'royaltes_percentage' => $request->getParam('systems')[1]['royaltes']['percentage'], 'maintenance_pc_value' => $request->getParam('systems')[1]['maintenance_pc']['value'], 'maintenance_pc_percentage' => $request->getParam('systems')[1]['maintenance_pc']['percentage'], 'outsourcing_value' => $request->getParam('systems')[1]['outsourcing']['value'], 'outsourcing_percentage' => $request->getParam('systems')[1]['outsourcing']['percentage'], 'bpo_value' => $request->getParam('systems')[1]['bpo']['value'], 'bpo_percentage' => $request->getParam('systems')[1]['bpo']['percentage'], 'kpi_type' => $kpi_type_comparative_entity, 'kpi' => $kpi_entity); (new ClassMethods())->hydrate($data_comparative_systems, $comparative_systems_entity); $this->em->persist($comparative_systems_entity); $this->em->flush(); $data_budgeted_groupbenner = array('revenues_initial' => $request->getParam('groupbenner')[2]['revenues']['initial'], 'revenues_end' => $request->getParam('groupbenner')[2]['revenues']['end'], 'revenues_target' => $request->getParam('groupbenner')[2]['revenues']['target'], 'revenues_percentage' => $request->getParam('groupbenner')[2]['revenues']['percentage'], 'ebtida_initial' => $request->getParam('groupbenner')[2]['ebtida']['initial'], 'ebtida_end' => $request->getParam('groupbenner')[2]['ebtida']['end'], 'ebtida_target' => $request->getParam('groupbenner')[2]['ebtida']['target'], 'ebtida_percentage' => $request->getParam('groupbenner')[2]['ebtida']['percentage'], 'net_profit_initial' => $request->getParam('groupbenner')[2]['net_profit']['initial'], 'net_profit_end' => $request->getParam('groupbenner')[2]['net_profit']['end'], 'net_profit_target' => $request->getParam('groupbenner')[2]['net_profit']['target'], 'net_profit_percentage' => $request->getParam('groupbenner')[2]['net_profit']['percentage'], 'kpi_type' => $kpi_type_budgeted_entity, 'kpi' => $kpi_entity); (new ClassMethods())->hydrate($data_budgeted_groupbenner, $budgeted_groupbenner_entity); $this->em->persist($budgeted_groupbenner_entity); $this->em->flush(); $data_budgeted_healthoperators = array('revenues_initial' => $request->getParam('healthoperators')[2]['revenues']['initial'], 'revenues_end' => $request->getParam('healthoperators')[2]['revenues']['end'], 'revenues_target' => $request->getParam('healthoperators')[2]['revenues']['target'], 'revenues_percentage' => $request->getParam('healthoperators')[2]['revenues']['percentage'], 'ebtida_initial' => $request->getParam('healthoperators')[2]['ebtida']['initial'], 'ebtida_end' => $request->getParam('healthoperators')[2]['ebtida']['end'], 'ebtida_target' => $request->getParam('healthoperators')[2]['ebtida']['target'], 'ebtida_percentage' => $request->getParam('healthoperators')[2]['ebtida']['percentage'], 'net_profit_initial' => $request->getParam('healthoperators')[2]['net_profit']['initial'], 'net_profit_end' => $request->getParam('healthoperators')[2]['net_profit']['end'], 'net_profit_target' => $request->getParam('healthoperators')[2]['net_profit']['target'], 'net_profit_percentage' => $request->getParam('healthoperators')[2]['net_profit']['percentage'], 'lu_value' => '0.00', 'lu_percentage' => '0.00', 'lum_value' => '0.00', 'lum_percentage' => '0.00', 'implantation_value' => '0.00', 'implantation_percentage' => '0.00', 'sms_value' => '0.00', 'sms_percentage' => '0.00', 'medical_services_value' => '0.00', 'medical_services_percentage' => '0.00', 'workout_value' => '0.00', 'workout_percentage' => '0.00', 'kpi_type' => $kpi_type_budgeted_entity, 'kpi' => $kpi_entity); (new ClassMethods())->hydrate($data_budgeted_healthoperators, $budgeted_healthoperators_entity); $this->em->persist($budgeted_healthoperators_entity); $this->em->flush(); $data_budgeted_hospital = array('revenues_initial' => $request->getParam('hospital')[2]['revenues']['initial'], 'revenues_end' => $request->getParam('hospital')[2]['revenues']['end'], 'revenues_target' => $request->getParam('hospital')[2]['revenues']['target'], 'revenues_percentage' => $request->getParam('hospital')[2]['revenues']['percentage'], 'ebtida_initial' => $request->getParam('hospital')[2]['ebtida']['initial'], 'ebtida_end' => $request->getParam('hospital')[2]['ebtida']['end'], 'ebtida_target' => $request->getParam('hospital')[2]['ebtida']['target'], 'ebtida_percentage' => $request->getParam('hospital')[2]['ebtida']['percentage'], 'net_profit_initial' => $request->getParam('hospital')[2]['net_profit']['initial'], 'net_profit_end' => $request->getParam('hospital')[2]['net_profit']['end'], 'net_profit_target' => $request->getParam('hospital')[2]['net_profit']['target'], 'net_profit_percentage' => $request->getParam('hospital')[2]['net_profit']['percentage'], 'lu_value' => '0.00', 'lu_percentage' => '0.00', 'lum_value' => '0.00', 'lum_percentage' => '0.00', 'implantation_value' => '0.00', 'implantation_percentage' => '0.00', 'kpi_type' => $kpi_type_budgeted_entity, 'kpi' => $kpi_entity); (new ClassMethods())->hydrate($data_budgeted_hospital, $budgeted_hospital_entity); $this->em->persist($budgeted_hospital_entity); $this->em->flush(); $data_budgeted_ominousmanagement = array('revenues_initial' => $request->getParam('ominousmanagement')[2]['revenues']['initial'], 'revenues_end' => $request->getParam('ominousmanagement')[2]['revenues']['end'], 'revenues_target' => $request->getParam('ominousmanagement')[2]['revenues']['target'], 'revenues_percentage' => $request->getParam('ominousmanagement')[2]['revenues']['percentage'], 'ebtida_initial' => $request->getParam('ominousmanagement')[2]['ebtida']['initial'], 'ebtida_end' => $request->getParam('ominousmanagement')[2]['ebtida']['end'], 'ebtida_target' => $request->getParam('ominousmanagement')[2]['ebtida']['target'], 'ebtida_percentage' => $request->getParam('ominousmanagement')[2]['ebtida']['percentage'], 'net_profit_initial' => $request->getParam('ominousmanagement')[2]['net_profit']['initial'], 'net_profit_end' => $request->getParam('ominousmanagement')[2]['net_profit']['end'], 'net_profit_target' => $request->getParam('ominousmanagement')[2]['net_profit']['target'], 'net_profit_percentage' => $request->getParam('ominousmanagement')[2]['net_profit']['percentage'], 'services_value' => '0.00', 'services_percentage' => '0.00', 'kpi_type' => $kpi_type_budgeted_entity, 'kpi' => $kpi_entity); (new ClassMethods())->hydrate($data_budgeted_ominousmanagement, $budgeted_ominousmanagement_entity); $this->em->persist($budgeted_ominousmanagement_entity); $this->em->flush(); $data_budgeted_systems = array('revenues_initial' => $request->getParam('systems')[2]['revenues']['initial'], 'revenues_end' => $request->getParam('systems')[2]['revenues']['end'], 'revenues_target' => $request->getParam('systems')[2]['revenues']['target'], 'revenues_percentage' => $request->getParam('systems')[2]['revenues']['percentage'], 'ebtida_initial' => $request->getParam('systems')[2]['ebtida']['initial'], 'ebtida_end' => $request->getParam('systems')[2]['ebtida']['end'], 'ebtida_target' => $request->getParam('systems')[2]['ebtida']['target'], 'ebtida_percentage' => $request->getParam('systems')[2]['ebtida']['percentage'], 'net_profit_initial' => $request->getParam('systems')[2]['net_profit']['initial'], 'net_profit_end' => $request->getParam('systems')[2]['net_profit']['end'], 'net_profit_target' => $request->getParam('systems')[2]['net_profit']['target'], 'net_profit_percentage' => $request->getParam('systems')[2]['net_profit']['percentage'], 'lu_value' => '0.00', 'lu_percentage' => '0.00', 'lum_value' => '0.00', 'lum_percentage' => '0.00', 'implantation_value' => '0.00', 'implantation_percentage' => '0.00', 'sms_value' => '0.00', 'sms_percentage' => '0.00', 'royaltes_value' => '0.00', 'royaltes_percentage' => '0.00', 'maintenance_pc_value' => '0.00', 'maintenance_pc_percentage' => '0.00', 'outsourcing_value' => '0.00', 'outsourcing_percentage' => '0.00', 'bpo_value' => '0.00', 'bpo_percentage' => '0.00', 'kpi_type' => $kpi_type_budgeted_entity, 'kpi' => $kpi_entity); (new ClassMethods())->hydrate($data_budgeted_systems, $budgeted_systems_entity); $this->em->persist($budgeted_systems_entity); $this->em->flush(); //--> Data for entity Systems - Colaboradores $data_contributors = array('contributors1YearNumberOfEmployees' => $request->getParam('contributors')[1]['number_of_employees'], 'contributors2YearNumberOfEmployees' => $request->getParam('contributors')[2]['number_of_employees'], 'contributors1YearIcons' => $request->getParam('contributors')[1]['icons'], 'contributors2YearIcons' => $request->getParam('contributors')[2]['icons'], 'contributors1YearBillingByEmployees' => $request->getParam('contributors')[1]['billing_by_employees'], 'contributors2YearBillingByEmployees' => $request->getParam('contributors')[2]['billing_by_employees'], 'kpi' => $kpi_entity); (new ClassMethods())->hydrate($data_contributors, $employees_entity); $this->em->persist($employees_entity); $this->em->flush(); return $response->withRedirect($this->router->pathFor('kpi')); } $data = ['kpi' => $kpi_entity, 'entities' => ['comparative' => ['groupbenner' => $comparative_groupbenner_entity, 'healthoperators' => $comparative_healthoperators_entity, 'hospital' => $comparative_hospital_entity, 'ominousmanagement' => $comparative_ominousmanagement_entity, 'systems' => $comparative_systems_entity], 'budgeted' => ['groupbenner' => $budgeted_groupbenner_entity, 'healthoperators' => $budgeted_healthoperators_entity, 'hospital' => $budgeted_hospital_entity, 'ominousmanagement' => $budgeted_ominousmanagement_entity, 'systems' => $budgeted_systems_entity], 'employees' => $employees_entity]]; $this->view->render($response, 'kpi/edit.twig', $data); return $response; }