PreventsCircularRecursion
trait PreventsCircularRecursion (View source)
Properties
static protected WeakMap<static,array<string,mixed>> | $recursionCache | The cache of objects processed to prevent infinite recursion. |
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
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.
static protected
clearRecursiveCallValue(object $object, string $hash)
Remove an entry from the recursion cache for an object.
static protected array
getRecursiveCallStack(object $object)
Get the stack of methods being called recursively for the current object.
static protected WeakMap
getRecursionCache()
Get the current recursion cache being used by the model.
static protected mixed
setRecursiveCallValue(object $object, string $hash, mixed $value)
Set a value in the recursion cache for the given object and method.