File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,13 @@ class Model {
144144 */
145145 public Cache |null $ cache = null ;
146146
147+ /**
148+ * @var bool $model_cache_exempt
149+ * If set to `true`, this Model will be exempt from any global Model caching mechanisms. This is primarily
150+ * used for Models that frequently change or are not suitable for caching.
151+ */
152+ public bool $ model_cache_exempt = false ;
153+
147154 /**
148155 * @var ModelSet $related_objects
149156 * A ModelSet containing foreign Model objects related to this Model. These are primarily populated by
@@ -1943,7 +1950,7 @@ class Model {
19431950 $ model = new $ model_name ();
19441951 $ model_objects = [];
19451952 $ requests_pagination = ($ limit or $ offset );
1946- $ cache_exempt = ($ requests_pagination or $ reverse or $ model ->internal_callable );
1953+ $ cache_exempt = ($ requests_pagination or $ reverse or $ model ->model_cache_exempt );
19471954
19481955 # Throw an error if pagination was requested on a Model without $many enabled
19491956 if (!$ model ->many and $ requests_pagination ) {
You can’t perform that action at this time.
0 commit comments