Interface CollectionInterface
Interface InterfaceGeneralCollection
This represents an iterable collection of Model elements.
-
DcGeneral\Data\CollectionInterface
implements
IteratorAggregate
Methods summary
public
integer
|
#
length( )
Get length of this collection.
Get length of this collection.
Returns
integer
|
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
|
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
|
public
|
|
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
|
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
|
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
|
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.
|
public
DcGeneral\Data\ModelInterface
|
#
reverse( )
Make a reverse sorted collection of this collection.
Make a reverse sorted collection of this collection.
Returns
|
public
DcGeneral\Data\ModelInterface
|
#
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
|
Methods inherited from IteratorAggregate
getIterator()
|