You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Meik Baum e40066784a add data & db files 12 months ago
..
Iterator add data & db files 12 months ago
Collection.php add data & db files 12 months ago
CollectionInterface.php add data & db files 12 months ago
CollectionTrait.php add data & db files 12 months ago
ExtractTrait.php add data & db files 12 months ago
LICENSE.txt add data & db files 12 months ago
README.md add data & db files 12 months ago
composer.json add data & db files 12 months ago
functions.php add data & db files 12 months ago

README.md

Total Downloads License

CakePHP Collection Library

The collection classes provide a set of tools to manipulate arrays or Traversable objects. If you have ever used underscore.js, you have an idea of what you can expect from the collection classes.

Usage

Collections can be created using an array or Traversable object. A simple use of a Collection would be:

use Cake\Collection\Collection;

$items = ['a' => 1, 'b' => 2, 'c' => 3];
$collection = new Collection($items);

// Create a new collection containing elements
// with a value greater than one.
$overOne = $collection->filter(function ($value, $key, $iterator) {
    return $value > 1;
});

The Collection\CollectionTrait allows you to integrate collection-like features into any Traversable object you have in your application as well.

Documentation

Please make sure you check the official documentation