コード例 #1
0
 /**
  * {@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();
 }
コード例 #2
0
 /**
  * {@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();
 }
コード例 #3
0
 /**
  * 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);
     }
 }
コード例 #4
0
 /**
  * {@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();
 }
コード例 #5
0
 public function getEntityLoader($entityName)
 {
     $loader = $this->_entityLoaders->get($entityName);
     $loader->setProductLoader($this);
     return $loader;
 }