Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ivopetkov/data-object

Repository files navigation

Data Object

A familiar and powerful Data Object abstraction for PHP.

Latest Stable Version License

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.

About

A familiar and powerful Data Object abstraction for PHP.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /