public
|
#
__construct( array $items = array() )
Create a new collection
Parameters
|
public static
static
|
#
make( mixed $items )
Create new collection instance
Create new collection instance
Parameters
Returns
static
|
public
mixed
|
#
get( mixed $key, mixed $default = null )
|
public
mixed
|
#
getKey( mixed $value, mixed $default = null )
|
public
mixed
|
#
first( mixed $default = null )
|
public
boolean
|
#
contains( mixed $value )
Determine if an item exists in the collection
Determine if an item exists in the collection
Parameters
Returns
boolean
|
public
|
#
each( Closure $callback )
Execute a callback over each item.
Execute a callback over each item.
Parameters
Returns
$this
|
public
string
|
#
toJson( integer $options = 0 )
json_encode the item array
json_encode the item array
Parameters
Returns
string
|
public
Traversable
|
#
getIterator( )
(PHP 5 >= 5.0.0)
Retrieve an external iterator
(PHP 5 >= 5.0.0)
Retrieve an external iterator
Returns
Traversable An instance of an object implementing Iterator or
Traversable
Link
Implementation of
IteratorAggregate::getIterator()
|
public
boolean
|
#
offsetExists( mixed $offset )
(PHP 5 >= 5.0.0)
Whether a offset exists
(PHP 5 >= 5.0.0)
Whether a offset exists
Parameters
- $offset
An offset to check for.
Returns
boolean true on success or false on failure.
<
p>
The return value will be casted to boolean if non-boolean was returned.
Link
Implementation of
ArrayAccess::offsetExists()
|
public
mixed
|
#
offsetGet( mixed $offset )
(PHP 5 >= 5.0.0)
Offset to retrieve
(PHP 5 >= 5.0.0)
Offset to retrieve
Parameters
- $offset
The offset to retrieve.
Returns
mixed Can return all value types.
Link
Implementation of
ArrayAccess::offsetGet()
|
public
|
#
offsetSet( mixed $offset, mixed $value )
(PHP 5 >= 5.0.0)
Offset to set
(PHP 5 >= 5.0.0)
Offset to set
Parameters
- $offset
The offset to assign the value to.
- $value
The value to set.
Link
Implementation of
ArrayAccess::offsetSet()
|
public
|
#
offsetUnset( mixed $offset )
(PHP 5 >= 5.0.0)
Offset to unset
(PHP 5 >= 5.0.0)
Offset to unset
Parameters
- $offset
The offset to unset.
Link
Implementation of
ArrayAccess::offsetUnset()
|
public
integer
|
#
count( )
(PHP 5 >= 5.1.0)
Count elements of an object
(PHP 5 >= 5.1.0)
Count elements of an object
Returns
integer The custom count as an integer.
<
p>
The return value is cast to an integer.
Link
Implementation of
Countable::count()
|
public
array
|
#
toArray( )
Get the array representation of an object
Get the array representation of an object
Returns
array
|
public
mixed
|
#
jsonSerialize( )
(PHP 5 >= 5.4.0)
Specify data which should be serialized to JSON
(PHP 5 >= 5.4.0)
Specify data which should be serialized to JSON
Returns
mixed data which can be serialized by json_encode,
which is a value of any type other than a resource.
Link
|