Methods summary
public
integer
|
#
length( )
Get length of this collection.
Get length of this collection.
Returns
integer
Implementation of
|
public
DcGeneral\Data\ModelInterface
|
#
get( integer $intIndex )
Get the model at a specific index.
Get the model at a specific index.
Parameters
- $intIndex
integer $intIndex The index of the model to retrieve.
Returns
Implementation of
|
public
|
#
add( DcGeneral\Data\ModelInterface $objModel )
Alias for push - Append a model to the end of this collection.
Alias for push - Append a model to the end of this collection.
Deprecated
Use push.
Parameters
Throws
Implementation of
|
public
|
#
push( DcGeneral\Data\ModelInterface $objModel )
Append a model to the end of this collection.
Append a model to the end of this collection.
Parameters
Throws
Implementation of
|
public
DcGeneral\Data\ModelInterface
|
#
pop( )
Remove the model at the end of the collection and return it.
Remove the model at the end of the collection and return it.
If the collection is empty, null will be returned.
Returns
Implementation of
|
public
|
|
public
DcGeneral\Data\ModelInterface
|
#
shift( )
Remove the model from the beginning of the collection and return it.
Remove the model from the beginning of the collection and return it.
If the collection is empty, null will be returned.
Returns
Implementation of
|
public
|
#
insert( integer $intIndex, DcGeneral\Data\ModelInterface $objModel )
Insert a record at the specific position.
Insert a record at the specific position.
Move all records at position >= $index one index up. If $index is out of
bounds, just add at the end (does not fill with empty records!).
Parameters
Implementation of
|
public
|
#
remove( mixed $mixedValue )
Remove the given index or model from the collection and renew the index.
Remove the given index or model from the collection and renew the index.
ATTENTION: Don't use key to unset in foreach because of the new index.
Parameters
- $mixedValue
mixed $mixedValue The index (integer) or InterfaceGeneralModel instance to remove.
Implementation of
|
public
DcGeneral\Data\CollectionInterface
|
#
reverse( )
Make a reverse sorted collection of this collection.
Make a reverse sorted collection of this collection.
Returns
Implementation of
|
public
DcGeneral\Data\CollectionInterface
|
#
sort( callable $callback )
Sort the records with the given callback and return the new sorted
collection.
Sort the records with the given callback and return the new sorted
collection.
Parameters
- $callback
callable $callback The callback function to use.
Returns
Implementation of
|
public
IteratorAggregate
|
#
getIterator( )
Get a iterator for this collection.
Get a iterator for this collection.
Returns
IteratorAggregate
|