Phalcon collection
NOTE
All classes are prefixed with Phalcon
Collection¶
-
Namespace
Phalcon\Support
-
Uses
ArrayAccess
ArrayIterator
Countable
InvalidArgumentException
IteratorAggregate
JsonSerializable
Phalcon\Collection\CollectionInterface
Serializable
Traversable
-
Extends
-
Implements
ArrayAccess
CollectionInterface
Countable
IteratorAggregate
JsonSerializable
Serializable
Phalcon\Collection
is a supercharged object oriented array. It implements: - ArrayAccess - Countable - IteratorAggregate - JsonSerializable - Serializable
It can be used in any part of the application that needs collection of data Such implementations are for instance accessing globals $_GET
, $_POST
etc.
Properties¶
/**
* @var array
*/
protected $data;
/**
* @var bool
*/
protected $insensitive = true;
/**
* @var array
*/
protected $lowerKeys;
Methods¶
Collection constructor. Magic getter to get an element from the collection Magic isset to check whether an element exists or not Magic setter to assign values to an element Magic unset to remove an element from the collection Clears the internal collection Count elements of an object. See count Get the element from the collection Returns the iterator of the class Return the keys as an array Return the values as an array Determines whether an element is present in the collection. Initialize internal array Specify data which should be serialized to JSON See jsonSerialize Whether a offset exists See offsetExists Offset to retrieve See offsetGet Offset to set See offsetSet Offset to unset See offsetUnset Delete the element from the collection String representation of object See serialize Set an element in the collection Returns the object in an array format Returns the object in a JSON formatThe default string uses the following options for json_encode
JSON_HEX_TAG
, JSON_HEX_APOS
, JSON_HEX_AMP
, JSON_HEX_QUOT
, JSON_UNESCAPED_SLASHES
See rfc4627
Constructs the object See unserialize Internal method to set dataCollection\CollectionInterface ¶
-
Namespace
Phalcon\Collection
-
Uses
-
Extends
-
Implements
Phalcon\Collection\CollectionInterface
Interface for Phalcon\Collection class
Methods¶
Collection\Exception¶
-
Namespace
Phalcon\Collection
-
Uses
Throwable
-
Extends
\Exception
-
Implements
Exceptions for the Collection object
Collection\ReadOnly¶
-
Namespace
Phalcon\Collection
-
Uses
Phalcon\Collection
-
Extends
Collection
-
Implements
A read only Collection object