protected function prepareLevelObject($levelId) { if ($levelId > 0) { $key = StringHelper::generateMd5Hash(BasicLevel::class, $levelId); if ($this->container !== null) { if ($this->container->exists($key)) { $this->level = $this->container->get($key); } else { $this->level = new BasicLevel($this->db); $this->level->setContainer($this->container); $this->level->load($levelId); $this->container->set($key, $this->level); } } else { $this->level = new BasicLevel($this->db); $this->level->load($levelId); } } }