コード例 #1
0
 protected function prepareRankObject($rankId)
 {
     if ($rankId > 0) {
         $key = StringHelper::generateMd5Hash(Rank::class, $rankId);
         if ($this->container !== null) {
             if ($this->container->exists($key)) {
                 $this->rank = $this->container->get($key);
             } else {
                 $this->rank = new BasicRank($this->db);
                 $this->rank->setContainer($this->container);
                 $this->rank->load($rankId);
                 $this->container->set($key, $this->rank);
             }
         } else {
             $this->rank = new BasicRank($this->db);
             $this->rank->load($rankId);
         }
     }
 }