dhii/data-object-abstract
最新稳定版本:v0.1-alpha1
Composer 安装命令:
composer require dhii/data-object-abstract
包简介
Abstract common functionality for data objects
README 文档
README
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.
统计信息
- 总下载量: 3.31k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 7
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-10-28