dailydealFactory = $dailydealFactory; $this->coreRegistry = $coreRegistry; $this->resultRedirectFactory = $context->getResultRedirectFactory(); parent::__construct($context); } /** * Init Dailydeal * * @return \Smartwave\Dailydeals\Model\Dailydeal */ protected function initDailydeal() { $dailydealId = (int) $this->getRequest()->getParam('dailydeal_id'); /** @var \Smartwave\Dailydeals\Model\Dailydeal $dailydeal */ $dailydeal = $this->dailydealFactory->create(); if ($dailydealId) { $dailydeal->load($dailydealId); } $this->coreRegistry->register('sw_dailydeals_dailydeal', $dailydeal); return $dailydeal; } }