|
Apache/2.4.41 (Ubuntu) Linux vmi616275.contaboserver.net 5.4.0-84-generic #94-Ubuntu SMP Thu Aug 26 20:27:37 UTC 2021 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) server ip : 62.171.164.128 | your ip : 127.0.0.1 safemode OFF > / home / a / home / dev2.destoffenstraat.com / app / code / MageArray / News / Model / |
Filename | /home/a/home/dev2.destoffenstraat.com/app/code/MageArray/News/Model/Newscomment.php |
Size | 1.45 kb |
Permission | rwxrwxrwx |
Owner | root : root |
Create time | 21-Aug-2025 12:26 |
Last modified | 06-Apr-2021 18:06 |
Last accessed | 24-Aug-2025 01:22 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
<?php
namespace MageArray\News\Model;
use MageArray\News\Helper\Data;
use Magento\Framework\Model\AbstractModel;
use Magento\Framework\Model\Context;
use Magento\Framework\Registry;
use Magento\Framework\UrlInterface;
/**
* Class Newscomment
* @package MageArray\News\Model
*/
class Newscomment extends AbstractModel
{
/**
* @var Data
*/
protected $_dataHelper;
/**
*
*/
protected function _construct()
{
$this->_init('MageArray\News\Model\ResourceModel\Newscomment');
}
/**
* @var UrlInterface
*/
protected $_urlModel;
/**
* Newscomment constructor.
* @param Context $context
* @param Registry $registry
* @param UrlInterface $urlModel
* @param Data $dataHelper
*/
public function __construct(
Context $context,
Registry $registry,
UrlInterface $urlModel,
Data $dataHelper
) {
parent::__construct($context, $registry);
$this->_dataHelper = $dataHelper;
$this->_urlModel = $urlModel;
}
/**
* @return mixed
*/
public function getCommentDate()
{
$dateFormat = $this->_dataHelper
->getStoreConfig('magearray_news/general/date_format');
return date($dateFormat, strtotime($this->getCommentedDate()));
}
/**
* @return $this
*/
public function beforeSave()
{
$this->_cacheManager->clean();
return $this;
}
}
namespace MageArray\News\Model;
use MageArray\News\Helper\Data;
use Magento\Framework\Model\AbstractModel;
use Magento\Framework\Model\Context;
use Magento\Framework\Registry;
use Magento\Framework\UrlInterface;
/**
* Class Newscomment
* @package MageArray\News\Model
*/
class Newscomment extends AbstractModel
{
/**
* @var Data
*/
protected $_dataHelper;
/**
*
*/
protected function _construct()
{
$this->_init('MageArray\News\Model\ResourceModel\Newscomment');
}
/**
* @var UrlInterface
*/
protected $_urlModel;
/**
* Newscomment constructor.
* @param Context $context
* @param Registry $registry
* @param UrlInterface $urlModel
* @param Data $dataHelper
*/
public function __construct(
Context $context,
Registry $registry,
UrlInterface $urlModel,
Data $dataHelper
) {
parent::__construct($context, $registry);
$this->_dataHelper = $dataHelper;
$this->_urlModel = $urlModel;
}
/**
* @return mixed
*/
public function getCommentDate()
{
$dateFormat = $this->_dataHelper
->getStoreConfig('magearray_news/general/date_format');
return date($dateFormat, strtotime($this->getCommentedDate()));
}
/**
* @return $this
*/
public function beforeSave()
{
$this->_cacheManager->clean();
return $this;
}
}