Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AbstractSynchronization.php
Go to the documentation of this file.
1 <?php
7 
13 {
17  protected $_syncFlag;
18 
24  protected $_identity;
25 
31  protected $_isDisplayed = null;
32 
36  public function __construct(\Magento\MediaStorage\Model\File\Storage\Flag $fileStorage)
37  {
38  $this->_syncFlag = $fileStorage->loadSelf();
39  }
40 
46  abstract protected function _shouldBeDisplayed();
47 
53  public function getIdentity()
54  {
55  return $this->_identity;
56  }
57 
63  public function isDisplayed()
64  {
65  if (null === $this->_isDisplayed) {
66  $output = $this->_shouldBeDisplayed();
67  if ($output) {
68  $this->_syncFlag->setState(\Magento\MediaStorage\Model\File\Storage\Flag::STATE_NOTIFIED);
69  $this->_syncFlag->save();
70  }
71  $this->_isDisplayed = $output;
72  }
73  return $this->_isDisplayed;
74  }
75 
81  public function getSeverity()
82  {
83  return \Magento\Framework\Notification\MessageInterface::SEVERITY_MAJOR;
84  }
85 }
__construct(\Magento\MediaStorage\Model\File\Storage\Flag $fileStorage)