getKey()] = $instance; }); } /** * Find entity by ID, either in DB, or in the internal cache. * * @param int $id * @return Model|null */ public static function getCached($id) { return isset(self::$instanceCache[$id]) ? self::$instanceCache[$id] : (self::$instanceCache[$id] = self::find($id)); } }