/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $em = $this->getContainer()->get('doctrine')->getManager(); $serializer = $this->getContainer()->get('serializer'); $user = new User(); $user->setName($input->getArgument('name'))->setApiKey($input->getArgument('apiKey')); $em->persist($user); $em->flush(); $output->writeln($serializer->serialize($user, 'json')); }
/** * Action to get user stylesheet * * @param \Barbon\PaymentPortalBundle\Entity\User $user * @return \Symfony\Component\HttpFoundation\Response * * @Framework\Route("/user/{id}/payment-portal-stylesheet.css") */ public function getUserPaymentPortalStylesheetAction(User $user) { // todo: need to handle this using the cache kernel return new PublicCacheResponse(600, $user->getPaymentPortalCss()); }