PHP Classes

ITE Collection: Manage sets of arrays or objects as collections

Recommend this page to a friend!
  Info   View files Documentation   View files View files (9)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 72%Total: 130 All time: 9,350 This week: 455Up
Version License PHP version Categories
ite-collection 1.1.2BSD License5.6PHP 5, Data types, Traits


This package can manage sets of arrays or objects as collections.

It provides two classes that can store unique values of arrays or objects.

It also provides a trait that provides basic functionality to any of the classes to manage the collection values.

Innovation Award
PHP Programming Innovation award nominee
August 2016
Number 7

Prize: One copy of the Zend Studio
PHP is very good at dealing with arrays of values. It provides interfaces that can let developers create classes that can manipulate lists of values using the regular array syntax and functions.

Often the code for manipulating different types of values is the same for different classes that implement array interfaces.

This package provides a trait that can manipulate collections of unique values that can be either arrays and objects. The trait may be reused by other classes that implement similar collections of other types of values.

Manuel Lemos
Picture of Kiril Savchev
  Performance   Level  
Name: Kiril Savchev <contact>
Classes: 6 packages by
Country: Bulgaria Bulgaria
Age: 38
All time rank: 266818 in Bulgaria Bulgaria
Week rank: 259 Up2 in Bulgaria Bulgaria Up
Innovation award
Innovation award
Nominee: 5x


If-Then-Else Collection Library

Class set for collections

It contains two different types of collections - ArrayCollection and ObjectCollection. ArrayCollection stores unique values in array. ObjectCollection stores unique objects, instances of a given class.


    // ArrayCollection usage:
    use Ite\Collection\ArrayCollection;

    $collection = new ArrayCollection();

    $collection2 = new ArrayCollection([1,44,'asd', 5 => PHP_INT_MAX]);
    //$max = $collection->remove(PHP_INT_MAX);
    //var_dump($collection->toArray(), $max);
    foreach ($collection as $key => $val) {
            echo $key.': '.$val.PHP_EOL;

    // ObjectCollection usage:
    use Ite\Collection\ObjectCollection;

    $collection = new ObjectCollection('\stdClass');
    $a = new stdClass();
    $b = new stdClass();
    $c = new stdClass();
    $d = new stdClass();
    $e = new stdClass();
    //$collection->set($c); -> throw exception
    foreach ($collection as $key => $val) {
            echo $key.': '.get_class($val).PHP_EOL;

  Files folder image Files  
File Role Description
Files folder imagesrc (4 files)
Files folder imagetests (2 files)
Accessible without login Plain text file composer.json Conf. composer file
Accessible without login Plain text file license Lic. license
Accessible without login Plain text file Doc. readme file

  Files folder image Files  /  src  
File Role Description
  Plain text file ArrayCollection.php Class ArrayCollection class
  Plain text file CollectionInterface.php Class CollectionInterface
  Plain text file CollectionTrait.php Class Base collection methods
  Plain text file ObjectCollection.php Class ObjectCollection class

  Files folder image Files  /  tests  
File Role Description
  Accessible without login Plain text file array_collection.php Example array collection tests
  Accessible without login Plain text file object_collection.php Example object collection examples

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:9,350
This week:455Up
 User Ratings  
 All time