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