geek 9f0c49094f s 5 anni fa
..
Iterator 9f0c49094f s 5 anni fa
Collection.php 9f0c49094f s 5 anni fa
CollectionInterface.php 9f0c49094f s 5 anni fa
CollectionTrait.php 9f0c49094f s 5 anni fa
ExtractTrait.php 9f0c49094f s 5 anni fa
LICENSE.txt 9f0c49094f s 5 anni fa
README.md 9f0c49094f s 5 anni fa
composer.json 9f0c49094f s 5 anni fa
functions.php 9f0c49094f s 5 anni fa

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