Exemplo n.º 1
0
 protected function prepareRewardObject($rewardId)
 {
     if ($rewardId > 0) {
         $key = StringHelper::generateMd5Hash(Reward::class, $rewardId);
         if ($this->container !== null) {
             if ($this->container->exists($key)) {
                 $this->reward = $this->container->get($key);
             } else {
                 $this->reward = new BasicReward($this->db);
                 $this->reward->setContainer($this->container);
                 $this->reward->load($rewardId);
                 $this->container->set($key, $this->reward);
             }
         } else {
             $this->reward = new BasicReward($this->db);
             $this->reward->load($rewardId);
         }
     }
 }