/**
  * {@inheritDoc}
  */
 public function prepareEntityBeforeCommit($type)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'prepareEntityBeforeCommit', array($type));
     return parent::prepareEntityBeforeCommit($type);
 }
Example #2
0
 /**
  * Change the association link for the upsell product
  * This routine is used only inside the model
  *
  * @param \XLite\Module\XC\Upselling\Model\UpsellingProduct $link             Related product link
  * @param boolean                                           $newBidirectional Bi-directional flag
  *
  * @return void
  */
 protected function changeBidirectionalLink($link, $newBidirectional)
 {
     $data = array('parentProduct' => $link->getProduct(), 'product' => $link->getParentProduct());
     $aLink = $this->findOneBy($data);
     $aLink ? \XLite\Core\Database::getEM()->remove($aLink) : null;
     if ($newBidirectional) {
         // Need to add link
         $this->insert($data);
     }
 }