ivopetkov / data-object
A familiar and powerful data object abstraction for PHP
Fund package maintenance!
ivopetkov
www.paypal.me/ivopetkovcom
Installs: 7 094
Dependents: 10
Suggesters: 0
Security: 0
Stars: 5
Watchers: 4
Forks: 2
Open Issues: 1
Requires
- php: 7.1.*|7.2.*|7.3.*|7.4.*|8.0.*|8.1.*|8.2.*|8.3.*
Requires (Dev)
- dev-master
- v1.6.1
- v1.6.0
- v1.5.0
- v1.4.0
- v1.3.0
- v1.2.1
- v1.2.0
- v1.1.0
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v0.9.0
- v0.8.3
- v0.8.2
- v0.8.1
- v0.8.0
- v0.7.3
- v0.7.2
- v0.7.1
- v0.7.0
- v0.6.0
- v0.5.18
- v0.5.17
- v0.5.16
- v0.5.15
- v0.5.14
- v0.5.13
- v0.5.12
- v0.5.11
- v0.5.10
- v0.5.9
- v0.5.8
- v0.5.7
- v0.5.6
- v0.5.5
- v0.5.4
- v0.5.3
- v0.5.2
- v0.5.1
- v0.5.0
- v0.4.7
- v0.4.6
- v0.4.5
- v0.4.4
- v0.4.3
- v0.4.2
- v0.4.1
- v0.4.0
- v0.3.0
- v0.2.0
- v0.1.0
This package is auto-updated.
Last update: 2024-10-31 00:21:00 UTC
README
A familiar and powerful Data Object abstraction for PHP.
Usage
Create an objects list from array:
use \IvoPetkov\DataList; $data = [ ['value' => 'a'], ['value' => 'b'], ['value' => 'c'] ]; $list = new DataList($data); // Can access the objects by index and get properties the following ways echo $list[0]->value; // Output: a echo $list[1]->value; // Output: b // Can loop through the objects foreach($list as $object){ echo $object->value; }
And here are same helpful methods to modify the list:
use \IvoPetkov\DataList; $list = new DataList([...]); $list ->filterBy('property1', '...') ->sortBy('property2') ->map(function($object){});
Install via Composer
composer require ivopetkov/data-object
Documentation
Full documentation is available as part of this repository.
License
This project is licensed under the MIT License. See the license file for more information.
Contributing
Feel free to open new issues and contribute to the project. Let's make it awesome and let's do in a positive way.
Authors
This library is created and maintained by Ivo Petkov (ivopetkov.com) and some awesome folks.