Description
Collections Abstraction library for PHP
The Collection library is one of the most useful things that many modern languages has, but for some reason PHP doesn't has a built in collection layer.
For that reason we created Collections, an incredible library that gathers the best of .NET's and Java's collections patterns and
unify it with PHP array power.
Take a look and see what we're talking about!!
Collections alternatives and similar libraries
Based on the "Data Structure and Storage" category.
Alternatively, view Collections alternatives based on common mentions on social networks and blogs.
-
Porter
:lipstick: Durable and asynchronous data imports for consuming data at scale and publishing testable SDKs. -
CRUDlex
CRUDlex is an easy to use CRUD generator for Symfony 4 and Silex 2 which is great for auto generated admin pages -
Cake Collection
[READ-ONLY] Collection library in CakePHP. This repo is a split of the main code that can be found in https://github.com/cakephp/cakephp
Cloudways' Black Friday Offer - 1st Choice of Developers
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Collections or a related project?
README
Collections
Collections Abstraction library for PHP
The Collection library is one of the most useful things that many modern languages has, but for some reason PHP doesn't has a built in collection layer.
For that reason we created Collections, an incredible library that gathers the best of .NET's and Java's collections patterns and unify it with PHP array power.
Take a look and see what we're talking about!!
Install
composer require easyframework/collections
Usage
The Collection Class
The Collection represents the List in .NET language or simply non-associative arrays in php:
$person1 = new \stdClass();
$person1->name = 'John';
$person1->age = 25;
$person2 = new \stdClass();
$person2->name = 'Maria';
$person2->age = 30;
$person3 = new \stdClass();
$person3->name = 'Anderson';
$person3->age = 15;
$collection = new Collections\Vector();
$collection->add($person1);
$collection->add($person2);
$collection->add($person3);
$collection->filter(function($person){
return $person->age > 18;
})->each(function($item){
echo $item->name; //John and Maria
});
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see License File for more information.
Documentation
More information can be found in the online documentation at https://italolelis.gitbooks.io/collections.
*Note that all licence references and agreements mentioned in the Collections README section above
are relevant to that project's source code only.