-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jacker
committed
Dec 15, 2022
1 parent
6199a9a
commit f105e4b
Showing
4 changed files
with
61 additions
and
100 deletions.
There are no files selected for viewing
129 changes: 57 additions & 72 deletions
129
...dispatchAdminActionControllerObserver.php → Cron/ProcessFeed.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,57 @@ | ||
<?php | ||
/** | ||
* Mageplaza | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the mageplaza.com license that is | ||
* available through the world-wide-web at this URL: | ||
* https://www.mageplaza.com/LICENSE.txt | ||
* | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade this extension to newer | ||
* version in the future. | ||
* | ||
* @category Mageplaza | ||
* @package Mageplaza_Core | ||
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/) | ||
* @license https://www.mageplaza.com/LICENSE.txt | ||
*/ | ||
|
||
namespace Mageplaza\Core\Observer; | ||
|
||
use Magento\Backend\Model\Auth\Session; | ||
use Magento\Framework\Event\Observer; | ||
use Magento\Framework\Event\ObserverInterface; | ||
use Mageplaza\Core\Helper\AbstractData; | ||
use Mageplaza\Core\Model\Feed; | ||
|
||
/** | ||
* Class PredispatchAdminActionControllerObserver | ||
* @package Mageplaza\Core\Observer | ||
*/ | ||
class PredispatchAdminActionControllerObserver implements ObserverInterface | ||
{ | ||
/** | ||
* @type Session | ||
*/ | ||
protected $_backendAuthSession; | ||
|
||
/** | ||
* @var AbstractData | ||
*/ | ||
protected $helper; | ||
|
||
/** | ||
* PredispatchAdminActionControllerObserver constructor. | ||
* | ||
* @param Session $backendAuthSession | ||
* @param AbstractData $helper | ||
*/ | ||
public function __construct( | ||
Session $backendAuthSession, | ||
AbstractData $helper | ||
) { | ||
$this->_backendAuthSession = $backendAuthSession; | ||
$this->helper = $helper; | ||
} | ||
|
||
/** | ||
* @param Observer $observer | ||
*/ | ||
public function execute(Observer $observer) | ||
{ | ||
if ($this->_backendAuthSession->isLoggedIn() | ||
&& $this->helper->isModuleOutputEnabled('Magento_AdminNotification')) { | ||
/* @var $feedModel Feed */ | ||
$feedModel = $this->helper->createObject(Feed::class); | ||
$feedModel->checkUpdate(); | ||
} | ||
} | ||
} | ||
<?php | ||
/** | ||
* Mageplaza | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the mageplaza.com license that is | ||
* available through the world-wide-web at this URL: | ||
* https://www.mageplaza.com/LICENSE.txt | ||
* | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade this extension to newer | ||
* version in the future. | ||
* | ||
* @category Mageplaza | ||
* @package Mageplaza_Core | ||
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/) | ||
* @license https://www.mageplaza.com/LICENSE.txt | ||
*/ | ||
|
||
namespace Mageplaza\Core\Cron; | ||
|
||
use Mageplaza\Core\Helper\AbstractData; | ||
use Mageplaza\Core\Model\Feed; | ||
|
||
/** | ||
* Class ProcessFeed | ||
* @package Mageplaza\Core\Cron | ||
*/ | ||
class ProcessFeed | ||
{ | ||
/** | ||
* @var AbstractData | ||
*/ | ||
protected $helper; | ||
|
||
/** | ||
* ProcessFeed constructor. | ||
* | ||
* @param AbstractData $helper | ||
*/ | ||
public function __construct( | ||
AbstractData $helper | ||
) { | ||
$this->helper = $helper; | ||
} | ||
|
||
public function execute() | ||
{ | ||
if ($this->helper->isModuleOutputEnabled('Magento_AdminNotification')) { | ||
/* @var $feedModel Feed */ | ||
$feedModel = $this->helper->createObject(Feed::class); | ||
$feedModel->checkUpdate(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters