Download the PHP package falbar/trait-adapter without Composer
On this page you can find all versions of the php package falbar/trait-adapter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package trait-adapter
trait-adapter, Packagist
Install
To install package, you need run command:
Usage
To create Adapter class, it is necessary to connect trait at the beginning AdapterTrait
. Next, define the property protected array $arMappingList
, where are the field correspondences denoted (it can be = [];
).
set
Attribute() метод должен быть protected
и возвращатьvoid
Examples object initialization
Examples
- Wrapper Adapter object:
Converting data to Adapter object:
- Converting object properties:
Converting data to Adapter object:
- Mapping object data:
Converting data to Adapter object:
- Creating collection:
Converting data to the Adapter collection:
Methods
Initialization methods
make()
- initializing object;mapping(array $arMappingList = [])
- defining array of matches;setCustom(array $arCustomData = [])
- transferring custom data to the Adapter class;create(array $arData = [])
- create object Adapter;createCollection(array $arDataList = [], int $iChunk = 500)
- create collection Adapter;toArray()
- convert to an array.
Inside the Adapter class
getOrigin(?string $sKey = null)
- get original value in the Adapter class;getCustom(?string $sKey = null)
- get a custom value in the Adapter class;getCustomByItemIndex(?string $sKey = null)
- get a custom value by index in the Adapter class.
All versions of trait-adapter with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.1
ext-json Version *
illuminate/container Version ^9.0|^10.0|^11.0
dusank/knapsack Version ^10.0
ext-json Version *
illuminate/container Version ^9.0|^10.0|^11.0
dusank/knapsack Version ^10.0
The package falbar/trait-adapter contains the following files
Loading the files please wait ....