Bolt\Events\CronEvent::__construct PHP Method

__construct() public method

Constructor.
public __construct ( Silex\Application $app, Symfony\Component\Console\Output\OutputInterface $output = null )
$app Silex\Application
$output Symfony\Component\Console\Output\OutputInterface
    public function __construct(Application $app, OutputInterface $output = null)
    {
        $this->app = $app;
        $this->output = $output;
        // Add listeners
        $this->app['dispatcher']->addListener(CronEvents::CRON_HOURLY, [$this, 'doRunScheduledJobs']);
        $this->app['dispatcher']->addListener(CronEvents::CRON_DAILY, [$this, 'doRunScheduledJobs']);
        $this->app['dispatcher']->addListener(CronEvents::CRON_WEEKLY, [$this, 'doRunScheduledJobs']);
        $this->app['dispatcher']->addListener(CronEvents::CRON_MONTHLY, [$this, 'doRunScheduledJobs']);
        $this->app['dispatcher']->addListener(CronEvents::CRON_YEARLY, [$this, 'doRunScheduledJobs']);
    }