Plop
A simple logging library for PHP
Plop\Collection Class Reference

A class that can be used to handle collections of objects. More...

+ Inheritance diagram for Plop\Collection:

Public Member Functions

 count ()
 
 getIterator ()
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 

Public Attributes

const TYPE_HINT = null
 

Protected Attributes

 $items = array()
 List of items in the collection.
 

Detailed Description

A class that can be used to handle collections of objects.

Definition at line 27 of file Collection.php.

Member Function Documentation

Plop\Collection::count ( )

Count elements of an object.

This method is executed when using the count() function on an object implementing the Countable interface.

Return values
intThe custom count as an integer.
See also
http://php.net/countable.count.php

Implements Countable.

Definition at line 35 of file Collection.php.

Plop\Collection::getIterator ( )

Retrieve an external iterator.

Return values
TraversableAn instance of an object implementing Iterator or Traversable
See also
http://php.net/iteratoraggregate.getiterator.php

Implements IteratorAggregate.

Definition at line 41 of file Collection.php.

Plop\Collection::offsetExists (   $offset)

Whether or not an offset exists.

This method is executed when using isset() or empty() on objects implementing ArrayAccess.

Parameters
mixed$offsetAn offset to check for.
Return values
boolTRUE is returned when the offset exists, FALSE when it doesn't.
See also
http://php.net/arrayaccess.offsetexists.php
Note
When using empty() ArrayAccess::offsetGet() will be called and checked for emptyness only if ArrayAccess::offsetExists() returns TRUE.

Implements ArrayAccess.

Definition at line 68 of file Collection.php.

Plop\Collection::offsetGet (   $offset)

Returns the value at the specified offset.

This method is executed when checking if offset is empty().

Parameters
mixed$offsetThe offset to retrieve.
Return values
mixedValue at the specified offset.
See also
http://php.net/arrayaccess.offsetget.php

Implements ArrayAccess.

Definition at line 47 of file Collection.php.

Plop\Collection::offsetSet (   $offset,
  $value 
)

Assigns a value to the specified offset.

Parameters
mixed$offsetThe offset to assign the value to.
mixed$valueThe value to set.
See also
http://php.net/arrayaccess.offsetset.php

Implements ArrayAccess.

Definition at line 53 of file Collection.php.

Plop\Collection::offsetUnset (   $offset)

Unsets an offset.

Parameters
mixed$offsetThe offset to unset.
See also
http://php.net/arrayaccess.offsetunset.php
Note
This method will not be called when type-casting to (unset).

Implements ArrayAccess.

Definition at line 76 of file Collection.php.


The documentation for this class was generated from the following file: