/** * @Route("/states/{state}", name="civix_front_superuser_settings_states_update") * @Method({"POST"}) * @Template("CivixFrontBundle:Superuser:statesSettings.html.twig") */ public function statesUpdateAction(State $state) { $csrfProvider = $this->get('form.csrf_provider'); if ($csrfProvider->isCsrfTokenValid('state_repr_update_' . $state->getCode(), $this->getRequest()->get('_token'))) { $this->get('civix_core.queue_task')->addToQueue('Civix\\CoreBundle\\Service\\Representative\\RepresentativeSTManager', 'synchronizeByStateCode', array($state->getCode())); $this->get('session')->getFlashBag()->add('notice', 'The representatives of the State will be updated.'); } else { $this->get('session')->getFlashBag()->add('error', 'State is not found'); } return $this->redirect($this->generateUrl('civix_front_superuser_settings_states')); }
public function getCode() { if ($this->__isInitialized__ === false) { return $this->_identifier["code"]; } $this->__load(); return parent::getCode(); }