Knp\Bundle\KnpBundlesBundle\Command\KbTweetTrendingBundleCommand::execute PHP Method

execute() protected method

protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        try {
            /* @var $twitterer \Knp\Bundle\KnpBundlesBundle\Twitterer\TrendingBundleTwitterer */
            $twitterer = $this->getContainer()->get('knp_bundles.trending_bundle_twitterer');
            $trendingBundle = $twitterer->tweet();
            $output->writeln(sprintf('Today trending bundle - %s has been tweeted', $trendingBundle->getName()));
        } catch (TrendingBundleNotFoundException $e) {
            $output->writeln('<error>Trending bundle not found</error>');
        }
    }
KbTweetTrendingBundleCommand