Skip to content

Commit d1c1d0c

Browse files
refactor: completely clear object cache on config change
1 parent 55b1cf4 commit d1c1d0c

File tree

1 file changed

+2
-4
lines changed
  • pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core

1 file changed

+2
-4
lines changed

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core/Model.inc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -533,10 +533,8 @@ class Model {
533533
* Clears the object cache for this Model class.
534534
*/
535535
public static function clear_object_cache(): void {
536-
$class = get_called_class();
537-
if (isset(self::$object_cache[$class])) {
538-
unset(self::$object_cache[$class]);
539-
}
536+
# Clear the object cache
537+
self::$object_cache = [];
540538

541539
# Clear foreign model indices
542540
RESTAPI\Fields\ForeignModelField::clear_model_index();

0 commit comments

Comments
 (0)