countryModels = []; } /** * Adds model to cache using key * * @param string $key * @param Country $model * @return void */ public function add(string $key, Country $model) : void { $this->countryModels[$key] = $model; } /** * Gets model from cache using key * * @param string $key * @return Country|null */ public function get(string $key) : ?Country { return $this->countryModels[$key] ?? null; } }