LazyGhostTrait uses \Symfony\Component\VarExporter\Internal\LazyObjectTrait
since Symfony 7.3, use native lazy objects instead
Table of Contents
Methods
- __clone() : void
- __destruct() : mixed
- __get() : mixed
- __isset() : bool
- __serialize() : array<string|int, mixed>
- __set() : void
- __unset() : void
- createLazyGhost() : static
- Creates a lazy-loading ghost instance.
- initializeLazyObject() : static
- Forces initialization of a lazy object and returns it.
- isLazyObjectInitialized() : bool
- Returns whether the object is initialized.
- resetLazyObject() : bool
- setLazyObjectAsInitialized() : void
Methods
__clone()
public
__clone() : void
__destruct()
public
__destruct() : mixed
__get()
public
& __get(mixed $name) : mixed
Parameters
- $name : mixed
__isset()
public
__isset(mixed $name) : bool
Parameters
- $name : mixed
Return values
bool__serialize()
public
__serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>__set()
public
__set(mixed $name, mixed $value) : void
Parameters
- $name : mixed
- $value : mixed
__unset()
public
__unset(mixed $name) : void
Parameters
- $name : mixed
createLazyGhost()
Creates a lazy-loading ghost instance.
public
static createLazyGhost(callable(static): void $initializer[, array<string, true>|null $skippedProperties = null ][, static|null $instance = null ]) : static
Skipped properties should be indexed by their array-cast identifier, see https://php.net/manual/language.types.array#language.types.array.casting
Parameters
- $initializer : callable(static): void
-
The closure should initialize the object it receives as argument
- $skippedProperties : array<string, true>|null = null
-
An array indexed by the properties to skip, a.k.a. the ones that the initializer doesn't initialize, if any
- $instance : static|null = null
Return values
staticinitializeLazyObject()
Forces initialization of a lazy object and returns it.
public
initializeLazyObject() : static
Return values
staticisLazyObjectInitialized()
Returns whether the object is initialized.
public
isLazyObjectInitialized([bool $partial = false ]) : bool
Parameters
- $partial : bool = false
-
Whether partially initialized objects should be considered as initialized
Attributes
- #[Ignore]
Return values
boolresetLazyObject()
public
resetLazyObject() : bool
Return values
bool —Returns false when the object cannot be reset, ie when it's not a lazy object
setLazyObjectAsInitialized()
private
setLazyObjectAsInitialized(bool $initialized) : void
Parameters
- $initialized : bool
Attributes
- #[Ignore]