Example #1
0
 /**
  * Prepare object for save
  *
  * @return $this
  */
 public function beforeSave()
 {
     if ($this->getQuote()) {
         $this->setQuoteId($this->getQuote()->getId());
     }
     return parent::beforeSave();
 }
Example #2
0
 /**
  * Prepare object for save
  *
  * @return $this
  */
 public function beforeSave()
 {
     if ($this->getQuote()) {
         $this->setQuoteId($this->getQuote()->getId());
     }
     try {
         $method = $this->getMethodInstance();
     } catch (\Magento\Framework\Exception\LocalizedException $e) {
         return parent::beforeSave();
     }
     $method->prepareSave();
     return parent::beforeSave();
 }