PreventsCircularRecursion
trait PreventsCircularRecursion
Constants
| protected RECURSION_CACHE_CONTEXT_KEY |
The context key for the recursion cache. |
Methods
Prevent a method from being called multiple times on the same object within the same call stack.
Remove an entry from the recursion cache for an object.
Get the stack of methods being called recursively for the current object.
Get the current recursion cache being used by the model.
Set a value in the recursion cache for the given object and method.
Details
at line 22
protected mixed
withoutRecursion(callable $callback, mixed $default = null)
Prevent a method from being called multiple times on the same object within the same call stack.
at line 52
static protected void
clearRecursiveCallValue(object $object, string $hash)
Remove an entry from the recursion cache for an object.
at line 66
static protected array
getRecursiveCallStack(object $object)
Get the stack of methods being called recursively for the current object.
at line 78
static protected WeakMap
getRecursionCache()
Get the current recursion cache being used by the model.
at line 86
static protected mixed
setRecursiveCallValue(object $object, string $hash, mixed $value)
Set a value in the recursion cache for the given object and method.