class DeltaConfigCollection extends MemoryConfigCollection (View source)

Applies config modifications as a set of deltas on top of the middleware, instead of as modifications to the underlying list.

Traits

Constants

REMOVE

Remove delta

MERGE

Merge delta

CLEAR

Remove all config for this class

REPLACE

Replace all config for this class

SET

Set delta

Methods

getMiddlewares()

No description

$this
setMiddlewares(Middleware[] $middlewares)

No description

$this
addMiddleware(Middleware $middleware)

No description

__construct(bool $trackMetadata = false, int $middlewareFlag = 0)

Construct a delta collection

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.

mixed
get(string $class, string $name = null, int|true $excludeMiddleware = 0)

Fetches value for a class, or a property on that 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

No description

$this
merge(string $class, string $name, mixed $value)

Merge a config for a class, or a field on that class

array
getMetadata()

Returns the entire metadata

getHistory()

No description

array
__serialize()

No description

void
__unserialize(array $data)

No description

string
serialize() deprecated

The __serialize() magic method will be automatically used instead of this

unserialize(string $serialized)

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

nest()

Get nested version of this config, which is normally duplicated version of this config, but could be a subclass.

createFromCollection(ConfigCollectionInterface $parent, int $middlewareFlag = 0)

Create a delta collection from a parent collection

getDeltaMiddleware()

Get middleware for handling deltas

array
getDeltas(string $class)

Get deltas for the given class

bool
isDeltaReset(string $class = null)

Check if config should be completely reset before getting config

__clone()

No description

Details

Middleware[] getMiddlewares()

Return Value

Middleware[]

$this setMiddlewares(Middleware[] $middlewares)

Parameters

Middleware[] $middlewares

Return Value

$this

$this addMiddleware(Middleware $middleware)

Parameters

Middleware $middleware

Return Value

$this

__construct(bool $trackMetadata = false, int $middlewareFlag = 0)

Construct a delta collection

Parameters

bool $trackMetadata
int $middlewareFlag

Flag to use to disable delta middleware (optional)

$this transform(TransformerInterface[] $transformers)

Trigger transformers to load into this store

Parameters

TransformerInterface[] $transformers

Return Value

$this

$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.

Parameters

string $class
string $name
$data
array $metadata

Return Value

$this

mixed get(string $class, string $name = null, int|true $excludeMiddleware = 0)

Fetches value for a class, or a property on that class

Parameters

string $class

Class name to retrieve config for

string $name

Optional class property to get

int|true $excludeMiddleware

Optional flag of middleware to disable. Passing in true disables all middleware. Can also pass in int flags to specify specific middlewares.

Return Value

mixed

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

Parameters

string $class

Class name to check config for

string $name

Optional class property to restrict check to

int|true $excludeMiddleware

Optional flag of middleware to disable. Passing in true disables all middleware. Can also pass in int flags to specify specific middlewares.

Return Value

bool

$this remove(string $class, string $name = null)

Remove config for a given class, or field on that class

Parameters

string $class
string $name

Return Value

$this

removeAll()

Delete all entries

array getAll()

Get complete config (excludes middleware-applied config)

Return Value

array

$this update(string $class, string $name, mixed $value) deprecated

deprecated 4.0...5.0 Synonym for merge()

Parameters

string $class
string $name
mixed $value

Return Value

$this

$this merge(string $class, string $name, mixed $value)

Merge a config for a class, or a field on that class

Parameters

string $class
string $name
mixed $value

Return Value

$this

array getMetadata()

Returns the entire metadata

Return Value

array

array __serialize()

Return Value

array

void __unserialize(array $data)

Parameters

array $data

Return Value

void

string serialize() deprecated

deprecated will be removed in 5.0

The __serialize() magic method will be automatically used instead of this

Return Value

string

unserialize(string $serialized)

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

Parameters

string $serialized

ConfigCollectionInterface nest()

Get nested version of this config, which is normally duplicated version of this config, but could be a subclass.

static DeltaConfigCollection createFromCollection(ConfigCollectionInterface $parent, int $middlewareFlag = 0)

Create a delta collection from a parent collection

Parameters

ConfigCollectionInterface $parent
int $middlewareFlag

Flag to use to disable delta middleware (optional)

Return Value

DeltaConfigCollection

DeltaMiddleware getDeltaMiddleware()

Get middleware for handling deltas

Return Value

DeltaMiddleware

array getDeltas(string $class)

Get deltas for the given class

Parameters

string $class

Return Value

array

bool isDeltaReset(string $class = null)

Check if config should be completely reset before getting config

Parameters

string $class

Class to check

Return Value

bool

__clone()