/** * {@inheritDoc} */ public function getParentProduct() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getParentProduct', array()); return parent::getParentProduct(); }
/** * 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); } }