@@ -34,14 +34,6 @@ protected function _construct()
3434 */
3535 public function _beforeSave (AbstractModel $ object )
3636 {
37- if (!$ object ->getExpirationDate ()) {
38- $ object ->setExpirationDate (null );
39- } elseif ($ object ->getExpirationDate () instanceof \DateTimeInterface) {
40- $ object ->setExpirationDate (
41- $ object ->getExpirationDate ()->format ('Y-m-d H:i:s ' )
42- );
43- }
44-
4537 // maintain single primary coupon per rule
4638 $ object ->setIsPrimary ($ object ->getIsPrimary () ? 1 : null );
4739
@@ -51,10 +43,10 @@ public function _beforeSave(AbstractModel $object)
5143 /**
5244 * Load primary coupon (is_primary = 1) for specified rule
5345 *
54- *
5546 * @param \Magento\SalesRule\Model\Coupon $object
5647 * @param \Magento\SalesRule\Model\Rule|int $rule
5748 * @return bool
49+ * @throws \Magento\Framework\Exception\LocalizedException
5850 */
5951 public function loadPrimaryByRule (\Magento \SalesRule \Model \Coupon $ object , $ rule )
6052 {
@@ -126,13 +118,6 @@ public function updateSpecificCoupons(\Magento\SalesRule\Model\Rule $rule)
126118 $ updateArray ['usage_per_customer ' ] = $ rule ->getUsesPerCustomer ();
127119 }
128120
129- $ ruleNewDate = new \DateTime ($ rule ->getToDate ());
130- $ ruleOldDate = new \DateTime ($ rule ->getOrigData ('to_date ' ));
131-
132- if ($ ruleNewDate != $ ruleOldDate ) {
133- $ updateArray ['expiration_date ' ] = $ rule ->getToDate ();
134- }
135-
136121 if (!empty ($ updateArray )) {
137122 $ this ->getConnection ()->update (
138123 $ this ->getTable ('salesrule_coupon ' ),
0 commit comments