MemoryConfigCollection
class MemoryConfigCollection implements MutableConfigCollectionInterface, Serializable (View source)
Basic mutable config collection stored in memory
Traits
Properties
protected | Middleware[] | $middlewares | from MiddlewareAware | |
protected | array | $config | Stores a list of key/value config prior to middleware being applied |
|
protected | array | $callCache | Call cache for non-trivial config calls including middleware |
|
protected | array | $metadata | ||
protected | array | $history | ||
protected | bool | $trackMetadata |
Methods
Call middleware to get decorated class config
Sets config for a given field.
Fetches value for a class, or a property on that class
Retrieve config for an entire class
Checks to see if a config item exists, or a property on that class
Remove config for a given class, or field on that class
The __unserialize() magic method will be automatically used instead of this almost all the time This method will be automatically used if existing serialized data was not saved as an associative array and the PHP version used in less than PHP 9.0
Get nested version of this config, which is normally duplicated version of this config, but could be a subclass.
Details
Middleware[]
getMiddlewares()
No description
$this
setMiddlewares(Middleware[] $middlewares)
No description
$this
addMiddleware(Middleware $middleware)
No description
protected array
callMiddleware(string $class, int|bool $excludeMiddleware, callable $last)
Call middleware to get decorated class config
__construct(bool $trackMetadata = false)
ConfigCollection constructor.
static MemoryConfigCollection
create()
No description
$this
transform(TransformerInterface[] $transformers)
Trigger transformers to load into this store
$this
set(string $class, string $name, $data, array $metadata = [])
Sets config for a given field.
Set name to null to set the config for the entire class.
mixed
get(string $class, string $name = null, int|true $excludeMiddleware = 0)
Fetches value for a class, or a property on that class
void
checkForDeprecatedConfig($class, $name)
No description
protected array
getClassConfig(string $class, int|true $excludeMiddleware = 0)
Retrieve config for an entire class
bool
exists(string $class, string $name = null, int|true $excludeMiddleware = 0)
Checks to see if a config item exists, or a property on that class
$this
remove(string $class, string $name = null)
Remove config for a given class, or field on that class
removeAll()
Delete all entries
array
getAll()
Get complete config (excludes middleware-applied config)
$this
update(string $class, string $name, mixed $value)
deprecated
deprecated
No description
$this
merge(string $class, string $name, mixed $value)
No description
array
getMetadata()
Returns the entire metadata
getHistory()
No description
protected array
getSerializedMembers()
Get list of serialized properties
array
__serialize()
No description
void
__unserialize(array $data)
No description
string
serialize()
deprecated
deprecated
The __serialize() magic method will be automatically used instead of this
unserialize(string $serialized)
deprecated
deprecated
The __unserialize() magic method will be automatically used instead of this almost all the time This method will be automatically used if existing serialized data was not saved as an associative array and the PHP version used in less than PHP 9.0
ConfigCollectionInterface
nest()
Get nested version of this config, which is normally duplicated version of this config, but could be a subclass.
protected
saveMetadata(string $class, array $metadata)
Save metadata for the given class