public function setEntityById($id) { $entity = $this->em->getRepository('FRDCarBundle:Carro')->find($id); if (!$entity) { throw $this->container->createNotFoundException("Registro não encontrado"); } $this->carro = $entity; }
function __construct(Container $container, $parameters) { parent::setContainer($container); $this->mode = $parameters['paypal']['mode']; $this->logLevel = $parameters['paypal']['logLevel']; $this->generateUniqueId(); }
/** * @inheritdoc */ public function setContainer(ContainerInterface $container = null) { parent::setContainer($container); foreach ($container->getParameter('fizz_import.batch') as $batch) { $this->register($batch['name'], $batch['class']); } }
/** * {@inheritDoc} */ public function load(ObjectManager $manager) { $Estabelecimento = new Estabelecimento(); $Estabelecimento->setUserSecret('admin'); $Estabelecimento->setUserKey('a'); $Estabelecimento->setNome('a'); $Estabelecimento->setEmail('admin'); $encoder = $this->container->get('security.encoder_factory')->getEncoder($Estabelecimento); $Estabelecimento->setSenha($encoder->encodePassword('secret', $Estabelecimento->getSalt())); // $Estabelecimento->setSenha('test'); $Estabelecimento->setCidade('a'); $Estabelecimento->setLat(11); $Estabelecimento->setLng(12); $Estabelecimento->setIsActive(true); $manager->persist($Estabelecimento); $manager->flush(); }
public function setContainer(ContainerInterface $container = null) { parent::setContainer($container); }
/** * {@inheritDoc} */ public function setContainer(ContainerInterface $container = null) { parent::setContainer($container); if (null === $this->tools) { $this->tools = $this->initTools(); } }
/** * Sets the Container associated with this Controller. * * @param ContainerInterface $container A ContainerInterface instance * * @api */ public function setContainer(ContainerInterface $container = null) { parent::setContainer($container); // Load settings. $this->settings = $this->container->getParameter('magento'); }
public function setContainer(ContainerInterface $container = null) { parent::setContainer($container); $this->registry = $this->container->get('doctrine'); }
/** * {@inheritDoc} */ public function setContainer(ContainerInterface $container = null) { parent::setContainer($container); $this->calculateStrategy->setContainer($container); }