Download the PHP package dhii/data-object-abstract without Composer
On this page you can find all versions of the php package dhii/data-object-abstract. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dhii/data-object-abstract
More information about dhii/data-object-abstract
Files in dhii/data-object-abstract
Package data-object-abstract
Short Description Abstract common functionality for data objects
License MIT
Informations about the package data-object-abstract
Dhii - Data - Object - Abstract
Details
This package contains abstract functionality for data objects. Data objects are objects that can contain, and optionally
manipulate, some internal data. The implementations in this package are based on containers, which means that anything
returned by _normalizeContainer
can have a data object based
on it. Another advantage of this implementation is that a data key can be anything that passes normalization by
normalizeString()
. All this makes this package an excellent base
for flexible, extensible data objects.
Important Notice: While the traits that access the internal store can work with any container, the _getDataStore()
method used by them MUST return an object for the methods that write to the store to have an effect. This is to avoid
having to use references, which would complicate the code and make it more error-prone, and less optimized.
Traits
GetDataCapableTrait
- Retrieves data by key from the internal store.SetDataCapableTrait
- Sets a data value by key in the internal store.SetManyCapableTrait
- Sets multiple data values by key-value map in the internal store.HasDataCapableTrait
- Establishes whether a key exists in the internal store.UnsetDataCapableTrait
- Removes data by key from the internal store.UnsetManyCapableTrait
- Removes multiple values by key list from the internal store.DataStoreAwareContainerTrait
- Retrieves the internal store.CreateDataStoreCapableTrait
- Creates an object that can serve as an internal store.NormalizeKeyCapableTrait
- Makes sure that a data key can be used to retrieve a value from the internal store.