| Current Path : /var/www/html/app/code/FlipsDigital/Faq/Model/ |
| Current File : /var/www/html/app/code/FlipsDigital/Faq/Model/Faq.php |
<?php
/**
* Faq.php
*
* @copyright Copyright © 2021 Test. All rights reserved.
* @author test@test.com
*/
namespace FlipsDigital\Faq\Model;
use Magento\Framework\DataObject\IdentityInterface;
use Magento\Framework\Model\AbstractModel;
class Faq extends AbstractModel implements IdentityInterface
{
/**
* CMS page cache tag
*/
const CACHE_TAG = 'flipsdigital_faq_faq';
/**
* @var string
*/
protected $_cacheTag = 'flipsdigital_faq_faq';
/**
* Prefix of model events names
*
* @var string
*/
protected $_eventPrefix = 'flipsdigital_faq_faq';
/**
* Initialize resource model
*
* @return void
*/
protected function _construct()
{
parent::_construct();
$this->_init('FlipsDigital\Faq\Model\ResourceModel\Faq');
}
/**
* Get identities
*
* @return array
*/
public function getIdentities()
{
return [self::CACHE_TAG . '_' . $this->getId()];
}
/**
* Save from collection data
*
* @param array $data
* @return $this|bool
*/
public function saveCollection(array $data)
{
if (isset($data[$this->getId()])) {
$this->addData($data[$this->getId()]);
$this->getResource()->save($this);
}
return $this;
}
}