101. Araxis Merge File Comparison Report

Produced by Araxis Merge on 2023-07-12 04:42:39 +0000. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

101.1 Files compared

#LocationFileLast Modified
1Porto v4.0.5/Theme Files/Porto Theme/app/code/Smartwave/Dailydeals/Model/ResourceModelDailydeal.php2018-03-14 03:57:52 +0000
2Porto v4.0.6/Theme Files/Porto Theme/app/code/Smartwave/Dailydeals/Model/ResourceModelDailydeal.php2023-06-09 02:43:01 +0000

101.2 Comparison summary

DescriptionBetween
Files 1 and 2
Text BlocksLines
Unchanged2162
Changed12
Inserted00
Removed00

101.3 Comparison options

WhitespaceConsecutive whitespace is treated as a single space
Character caseDifferences in character case are significant
Line endingsDifferences in line endings (CR and LF characters) are ignored
CR/LF charactersNot shown in the comparison detail
Active line-pairing rules

101.4 Active regular expressions

No regular expressions were active.

101.5 Comparison detail

1 <?php 1 <?php
2 namespace Smartwave\Dailydeals\Model\ResourceModel; 2 namespace Smartwave\Dailydeals\Model\ResourceModel;
3  3 
4 class Dailydeal extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb 4 class Dailydeal extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
5 { 5 {
6     /** 6     /**
7      * Date time handler 7      * Date time handler
8      * 8      *
9      * @var \Magento\Framework\Stdlib\DateTime 9      * @var \Magento\Framework\Stdlib\DateTime
10      */ 10      */
11     protected $dateTime; 11     protected $dateTime;
12  12 
13     /** 13     /**
14      * Date model 14      * Date model
15      * 15      *
16      * @var \Magento\Framework\Stdlib\DateTime\DateTime 16      * @var \Magento\Framework\Stdlib\DateTime\DateTime
17      */ 17      */
18     protected $date; 18     protected $date;
19  19 
20     /** 20     /**
21      * constructor 21      * constructor
22      * 22      *
23      * @param \Magento\Framework\Stdlib\DateTime $dateTime 23      * @param \Magento\Framework\Stdlib\DateTime $dateTime
24      * @param \Magento\Framework\Stdlib\DateTime\DateTime $date 24      * @param \Magento\Framework\Stdlib\DateTime\DateTime $date
25      * @param \Magento\Framework\Model\ResourceModel\Db\Context $context 25      * @param \Magento\Framework\Model\ResourceModel\Db\Context $context
26      */ 26      */
27     public function __construct( 27     public function __construct(
28         \Magento\Framework\Stdlib\DateTime $dateTime, 28         \Magento\Framework\Stdlib\DateTime $dateTime,
29         \Magento\Framework\Stdlib\DateTime\DateTime $date, 29         \Magento\Framework\Stdlib\DateTime\DateTime $date,
30         \Magento\Framework\Model\ResourceModel\Db\Context $context 30         \Magento\Framework\Model\ResourceModel\Db\Context $context
31     ) { 31     ) {
32      32 
33         $this->dateTime = $dateTime; 33         $this->dateTime = $dateTime;
34         $this->date     = $date; 34         $this->date     = $date;
35         parent::__construct($context); 35         parent::__construct($context);
36     } 36     }
37  37 
38  38 
39     /** 39     /**
40      * Initialize resource model 40      * Initialize resource model
41      * 41      *
42      * @return void 42      * @return void
43      */ 43      */
44     protected function _construct() 44     protected function _construct()
45     { 45     {
46         $this->_init('sw_dailydeals_dailydeal', 'dailydeal_id'); 46         $this->_init('sw_dailydeals_dailydeal', 'dailydeal_id');
47     } 47     }
48  48 
49     /** 49     /**
50      * Retrieves Dailydeal Product Sku from DB by passed id. 50      * Retrieves Dailydeal Product Sku from DB by passed id.
51      * 51      *
52      * @param string $id 52      * @param string $id
53      * @return string|bool 53      * @return string|bool
54      */ 54      */
55     public function getDailydealSw_product_skuById($id) 55     public function getDailydealSw_product_skuById($id)
56     { 56     {
57         $adapter = $this->getConnection(); 57         $adapter = $this->getConnection();
58         $select = $adapter->select() 58         $select = $adapter->select()
59             ->from($this->getMainTable(), 'sw_product_sku') 59             ->from($this->getMainTable(), 'sw_product_sku')
60             ->where('dailydeal_id = :dailydeal_id'); 60             ->where('dailydeal_id = :dailydeal_id');
61         $binds = ['dailydeal_id' => (int)$id]; 61         $binds = ['dailydeal_id' => (int)$id];
62         return $adapter->fetchOne($select, $binds); 62         return $adapter->fetchOne($select, $binds);
63     } 63     }
64     /** 64     /**
65      * before save callback 65      * before save callback
66      * 66      *
67      * @param \Magento\Framework\Model\AbstractModel|\Smartwave\Dailydeals\Model\Dailydeal $object 67      * @param \Magento\Framework\Model\AbstractModel|\Smartwave\Dailydeals\Model\Dailydeal $object
68      * @return $this 68      * @return $this
69      */ 69      */
70     protected function _beforeSave(\Magento\Framework\Model\AbstractModel $object) 70     protected function _beforeSave(\Magento\Framework\Model\AbstractModel $object)
71     { 71     {
72         $object->setUpdatedAt($this->date->date()); 72         $object->setUpdatedAt($this->date->date());
73         if ($object->isObjectNew()) { 73         if ($object->isObjectNew()) {
74             $object->setCreatedAt($this->date->date()); 74             $object->setCreatedAt($this->date->date());
75         } 75         }
76         foreach (['sw_date_from', 'sw_date_to'] as $field) { 76         foreach (['sw_date_from', 'sw_date_to'] as $field) {
77             $value = !$object->getData($field) ? null : $object->getData($field); 77             $value = !$object->getData($field) ? null : $object->getData($field);
78             $object->setData($field, $this->dateTime->formatDate($value)); 78             $object->setData($field, $this->dateTime->formatDate($value));
79         } 79         }
80         return parent::_beforeSave($object); 80         return parent::_beforeSave($object);
81     } 81     }
82 } 82 }