class PropelCollection extends ArrayObject implements Serializable
Class for iterating over a list of Propel elements The collection keys must be integers - no associative array accepted
Methods
array |
getData()
Get the data in the collection |
|
setData(array $data)
Set the data in the collection |
||
int |
getPosition()
Gets the position of the internal pointer This position can be later used in seek() |
|
mixed |
getFirst()
Move the internal pointer to the beginning of the list And get the first element in the collection |
|
boolean |
isFirst()
Check whether the internal pointer is at the beginning of the list |
|
mixed |
getPrevious()
Move the internal pointer backward And get the previous element in the collection |
|
mixed |
getCurrent()
Get the current element in the collection |
|
mixed |
getNext()
Move the internal pointer forward And get the next element in the collection |
|
mixed |
getLast()
Move the internal pointer to the end of the list And get the last element in the collection |
|
boolean |
isLast()
Check whether the internal pointer is at the end of the list |
|
boolean |
isEmpty()
Check if the collection is empty |
|
boolean |
isOdd()
Check if the current index is an odd integer |
|
boolean |
isEven()
Check if the current index is an even integer |
|
mixed |
get(mixed $key)
Get an element from its key Alias for ArrayObject::offsetGet() |
|
mixed |
pop()
Pops an element off the end of the collection |
|
mixed |
shift()
Pops an element off the beginning of the collection |
|
int |
prepend(mixed $value)
Prepend one or more elements to the beginning of the collection |
|
set(mixed $key, mixed $value)
Add an element to the collection with the given key Alias for ArrayObject::offsetSet() |
||
mixed |
remove(mixed $key)
Removes a specified collection element Alias for ArrayObject::offsetUnset() |
|
array |
clear()
Clears the collection |
|
boolean |
contains(mixed $element)
Whether or not this collection contains a specified element |
|
mixed |
search(mixed $element)
Search an element in the collection |
|
serialize() | ||
unserialize($data) | ||
getIterator()
Overrides ArrayObject::getIterator() to save the iterator object for internal use e.g. |
||
getInternalIterator() | ||
clearIterator()
Clear the internal Iterator. |
||
setModel(string $model)
Set the model of the elements in the collection |
||
string |
getModel()
Get the model of the elements in the collection |
|
string |
getPeerClass()
Get the peer class of the elements in the collection |
|
setFormatter(PropelFormatter $formatter) | ||
getFormatter() | ||
PropelPDO |
getConnection(string $type = Propel::CONNECTION_READ)
Get a connection object for the database containing the elements of the collection |
|
BaseObject |
importFrom(mixed $parser, string $data)
Populate the current collection from a string, using a given parser format <code> $coll = new PropelObjectCollection(); $coll->setModel('Book'); $coll->importFrom('JSON', '{{"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}}'); </code> |
|
string |
exportTo(mixed $parser)
Export the current collection to a string, using a given parser format <code> $books = BookQuery::create()->find(); echo $book->exportTo('JSON'); => {{"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}}'); </code> |
|
__call($name, $params)
Catches calls to undefined methods. |
||
__toString()
Returns a string representation of the current collection. |
Details
at line 41
public array
getData()
Get the data in the collection
at line 51
public
setData(array $data)
Set the data in the collection
at line 62
public int
getPosition()
Gets the position of the internal pointer This position can be later used in seek()
at line 73
public mixed
getFirst()
Move the internal pointer to the beginning of the list And get the first element in the collection
at line 84
public boolean
isFirst()
Check whether the internal pointer is at the beginning of the list
at line 95
public mixed
getPrevious()
Move the internal pointer backward And get the previous element in the collection
at line 111
public mixed
getCurrent()
Get the current element in the collection
at line 122
public mixed
getNext()
Move the internal pointer forward And get the next element in the collection
at line 134
public mixed
getLast()
Move the internal pointer to the end of the list And get the last element in the collection
at line 150
public boolean
isLast()
Check whether the internal pointer is at the end of the list
at line 166
public boolean
isEmpty()
Check if the collection is empty
at line 176
public boolean
isOdd()
Check if the current index is an odd integer
at line 186
public boolean
isEven()
Check if the current index is an even integer
at line 199
public mixed
get(mixed $key)
Get an element from its key Alias for ArrayObject::offsetGet()
at line 212
public mixed
pop()
Pops an element off the end of the collection
at line 228
public mixed
shift()
Pops an element off the beginning of the collection
at line 246
public int
prepend(mixed $value)
Prepend one or more elements to the beginning of the collection
at line 264
public
set(mixed $key, mixed $value)
Add an element to the collection with the given key Alias for ArrayObject::offsetSet()
at line 277
public mixed
remove(mixed $key)
Removes a specified collection element Alias for ArrayObject::offsetUnset()
at line 290
public array
clear()
Clears the collection
at line 302
public boolean
contains(mixed $element)
Whether or not this collection contains a specified element
at line 314
public mixed
search(mixed $element)
Search an element in the collection
at line 321
public
serialize()
at line 330
public
unserialize($data)
at line 343
public
getIterator()
Overrides ArrayObject::getIterator() to save the iterator object for internal use e.g.
getNext(), isOdd(), etc.
at line 349
public
getInternalIterator()
at line 363
public
clearIterator()
Clear the internal Iterator.
PHP 5.3 doesn't know how to free a PropelCollection object if it has an attached
Iterator, so this must be done manually to avoid memory leaks.
at line 375
public
setModel(string $model)
Set the model of the elements in the collection
at line 385
public string
getModel()
Get the model of the elements in the collection
at line 395
public string
getPeerClass()
Get the peer class of the elements in the collection
at line 403
public
setFormatter(PropelFormatter $formatter)
at line 408
public
getFormatter()
at line 420
public PropelPDO
getConnection(string $type = Propel::CONNECTION_READ)
Get a connection object for the database containing the elements of the collection
at line 441
public BaseObject
importFrom(mixed $parser, string $data)
Populate the current collection from a string, using a given parser format <code> $coll = new PropelObjectCollection(); $coll->setModel('Book'); $coll->importFrom('JSON', '{{"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}}'); </code>
at line 461
public string
exportTo(mixed $parser)
Export the current collection to a string, using a given parser format <code> $books = BookQuery::create()->find(); echo $book->exportTo('JSON'); => {{"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}}'); </code>
at line 474
public
__call($name, $params)
Catches calls to undefined methods.
Provides magic import/export method support (fromXML()/toXML(), fromYAML()/toYAML(), etc.).
Allows to define default __call() behavior if you use a custom BaseObject
at line 490
public
__toString()
Returns a string representation of the current collection.
Based on the string representation of the underlying objects, defined in
the Peer::DEFAULT_STRING_FORMAT constant