Interface CollectionInterface
Defines a model collection.
-
Charcoal\Model\CollectionInterface
implements
ArrayAccess,
Countable,
IteratorAggregate
Methods summary
public
Charcoal\Model\CollectionInterface
|
#
merge( array|Traversable $objs )
Merge the collection with the given objects.
Merge the collection with the given objects.
Parameters
- $objs
- Array of objects to append to this collection.
Returns
|
public
Charcoal\Model\CollectionInterface
|
#
add( object $obj )
Add an object to the collection.
Add an object to the collection.
Parameters
- $obj
- An acceptable object.
Returns
|
public
object|null
|
#
get( mixed $key )
Retrieve the object by primary key.
Retrieve the object by primary key.
Parameters
Returns
object|null The object or NULL if not in the collection.
|
public
boolean
|
#
has( string $key )
Determine if an object exists in the collection by key.
Determine if an object exists in the collection by key.
Parameters
- $key
- The primary key to lookup.
Returns
boolean
|
public
Charcoal\Model\CollectionInterface
|
#
remove( mixed $key )
Remove object from collection by primary key.
Remove object from collection by primary key.
Parameters
- $key
- The object primary key to remove.
Returns
|
public
Charcoal\Model\CollectionInterface
|
#
clear( )
Remove all objects from collection.
Remove all objects from collection.
Returns
|
public
object[]
|
#
all( )
Retrieve all objects in collection indexed by primary keys.
Retrieve all objects in collection indexed by primary keys.
Returns
object[] An associative array of objects.
|
public
object[]
|
#
values( )
Retrieve all objects in the collection indexed numerically.
Retrieve all objects in the collection indexed numerically.
Returns
object[] A sequential array of objects.
|
public
array
|
#
keys( )
Retrieve the primary keys of the objects in the collection.
Retrieve the primary keys of the objects in the collection.
Returns
array A sequential array of keys.
|
Methods inherited from ArrayAccess
offsetExists(),
offsetGet(),
offsetSet(),
offsetUnset()
|
Methods inherited from Countable
count()
|
Methods inherited from IteratorAggregate
getIterator()
|