/** * {@inheritDoc} */ public function getProduct() { if ($this->_productID && !parent::getProduct() && $this->_loaders->exists('product')) { $product = $this->_loaders->get('product')->getByID($this->_productID); $this->setProduct($product); } return parent::getProduct(); }
/** * {@inheritDoc} */ public function getRewardOptions() { if (null === $this->_rewardOptions) { $rewardOptions = $this->_loaders->get('reward_option')->load($this); if (!$rewardOptions) { throw new \LogicException('Could not load reward options!'); } foreach ($rewardOptions as $rewardOption) { $this->addRewardOption($rewardOption); } } return parent::getRewardOptions(); }
/** * Lazy load the prices for the bundle */ private function _loadPrices() { $prices = $this->_loaders->get('price')->getPrices($this); foreach ($prices as $currencyID => $price) { $this->setPrice($price, $currencyID); } }
/** * {@inheritDoc} */ public function getRewardConfig() { if (null === $this->_rewardConfig) { if (null === $this->_rewardConfigID) { throw new \LogicException('No reward config ID set on ReferralProxy object!'); } $rewardConfig = $this->_loaders->get('reward_config')->load($this); if (!$rewardConfig) { throw new \LogicException('Could not load reward config with ID `' . $this->_rewardConfigID . '`'); } $this->setRewardConfig($rewardConfig); } return parent::getRewardConfig(); }
public function getEntityLoader($entityName) { $loader = $this->_entityLoaders->get($entityName); $loader->setProductLoader($this); return $loader; }