/**
  * Creates a new item schema for the game with the given application ID and
  * with descriptions in the given language
  *
  * @param int $appId The application ID of the game
  * @param string $language The language of description strings
  * @param bool $fetch if <var>true</var> the schemas's data is fetched
  *        after creation
  * @param bool $bypassCache if <var>true</var> the schemas's data is
  *        fetched again even if it has been cached already
  * @return GameInventory The item schema for the given game and language
  */
 public static function create($appId, $language, $fetch = true, $bypassCache = false)
 {
     if (GameItemSchema::isCached($appId, $language) && !$bypassCache) {
         $itemSchema = self::$cache[$appId][$language];
         if ($fetch && !$itemSchema->isFetched()) {
             $itemSchema->fetch();
         }
         return $itemSchema;
     } else {
         return new GameItemSchema($appId, $language, $fetch);
     }
 }
                $itemLevels = [];
                foreach ($itemLevelType->levels as $itemLevel) {
                    $itemLevels[$itemLevel->level] = $itemLevel->name;
                }
                $this->itemLevels[$itemLevelType->name] = $itemLevels;
            }
        }
        $this->itemSets = [];
        foreach ($data->item_sets as $itemSet) {
            $this->itemSets[$itemSet->item_set] = $itemSet;
        }
        $this->origins = [];
        foreach ($data->originNames as $origin) {
            $this->origins[$origin->origin] = $origin->name;
        }
        $this->qualities = [];
        $index = -1;
        foreach ($data->qualities as $key => $value) {
            $index++;
            if (property_exists($data->qualityNames, $key)) {
                $qualityName = $data->qualityNames->{$key};
            }
            if (empty($qualityName)) {
                $qualityName = ucwords($key);
            }
            $this->qualities[$index] = $qualityName;
        }
    }
}
GameItemSchema::initialize();
 /**
  * Returns the item schema
  *
  * The item schema is fetched first if not done already
  *
  * @return GameItemSchema The item schema for the game this inventory belongs to
  * @throws WebApiException on Web API errors
  */
 public function getItemSchema()
 {
     if ($this->itemSchema == null) {
         $this->itemSchema = GameItemSchema::create($this->appId, self::$schemaLanguage);
     }
     return $this->itemSchema;
 }