dateTime = $dateTime; parent::__construct( $context, $registry, $resource, $resourceCollection, $data ); } /** * Constructor. * * @return null */ public function _construct() { parent::_construct(); $this->_init(\Dotdigitalgroup\Email\Model\ResourceModel\Review::class); } /** * Prepare data to be saved to database. * * @return $this */ public function beforeSave() { parent::beforeSave(); if ($this->isObjectNew() && !$this->getCreatedAt()) { $this->setCreatedAt($this->dateTime->formatDate(true)); } $this->setUpdatedAt($this->dateTime->formatDate(true)); return $this; } }