class PropelArrayCollection extends PropelCollection
Class for iterating over a list of Propel objects stored as arrays
Methods
array |
getData()
Get the data in the collection |
from PropelCollection |
setData(array $data)
Set the data in the collection |
from PropelCollection | |
integer |
getPosition()
Gets the position of the internal pointer This position can be later used in seek() |
from PropelCollection |
mixed |
getFirst()
Move the internal pointer to the beginning of the list And get the first element in the collection |
from PropelCollection |
boolean |
isFirst()
Check whether the internal pointer is at the beginning of the list |
from PropelCollection |
mixed |
getPrevious()
Move the internal pointer backward And get the previous element in the collection |
from PropelCollection |
mixed |
getCurrent()
Get the current element in the collection |
from PropelCollection |
mixed |
getNext()
Move the internal pointer forward And get the next element in the collection |
from PropelCollection |
mixed |
getLast()
Move the internal pointer to the end of the list And get the last element in the collection |
from PropelCollection |
boolean |
isLast()
Check whether the internal pointer is at the end of the list |
from PropelCollection |
boolean |
isEmpty()
Check if the collection is empty |
from PropelCollection |
boolean |
isOdd()
Check if the current index is an odd integer |
from PropelCollection |
boolean |
isEven()
Check if the current index is an even integer |
from PropelCollection |
mixed |
get(mixed $key)
Get an element from its key Alias for ArrayObject::offsetGet() |
from PropelCollection |
mixed |
pop()
Pops an element off the end of the collection |
from PropelCollection |
mixed |
shift()
Pops an element off the beginning of the collection |
from PropelCollection |
integer |
prepend(mixed $value)
Prepend one or more elements to the beginning of the collection |
from PropelCollection |
set(mixed $key, mixed $value)
Add an element to the collection with the given key Alias for ArrayObject::offsetSet() |
from PropelCollection | |
mixed |
remove(mixed $key)
Removes a specified collection element Alias for ArrayObject::offsetUnset() |
from PropelCollection |
array |
clear()
Clears the collection |
from PropelCollection |
boolean |
contains(mixed $element)
Whether or not this collection contains a specified element |
from PropelCollection |
mixed |
search(mixed $element)
Search an element in the collection |
from PropelCollection |
string | serialize() | from PropelCollection |
unserialize(string $data) | from PropelCollection | |
ArrayIterator |
getIterator()
Overrides ArrayObject::getIterator() to save the iterator object for internal use e.g. |
from PropelCollection |
ArrayIterator | getInternalIterator() | from PropelCollection |
clearIterator()
Clear the internal Iterator. |
from PropelCollection | |
setModel(string $model)
Set the model of the elements in the collection |
from PropelCollection | |
string |
getModel()
Get the model of the elements in the collection |
from PropelCollection |
string |
getPeerClass()
Get the peer class of the elements in the collection |
from PropelCollection |
setFormatter(PropelFormatter $formatter) | from PropelCollection | |
PropelFormatter | getFormatter() | from PropelCollection |
PropelPDO |
getConnection(string $type = Propel::CONNECTION_READ)
Get a connection object for the database containing the elements of the collection |
from PropelCollection |
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> |
from PropelCollection |
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> |
from PropelCollection |
array|string |
__call(string $name, mixed $params)
Catches calls to undefined methods. |
from PropelCollection |
string |
__toString()
Returns a string representation of the current collection. |
from PropelCollection |
save(PropelPDO $con = null)
Save all the elements in the collection |
||
delete(PropelPDO $con = null)
Delete all the elements in the collection |
||
array |
getPrimaryKeys(boolean $usePrefix = true)
Get an array of the primary keys of all the objects in the collection |
|
fromArray(array $arr)
Populates the collection from an array Uses the object model to force the column types Does not empty the collection before adding the data from the array |
||
array |
toArray(string $keyColumn = null, boolean $usePrefix = false)
Get an array representation of the collection This is not an alias for getData(), since it returns a copy of the data |
|
array |
getArrayCopy(string $keyColumn = null, boolean $usePrefix = false)
Synonym for toArray(), to provide a similar interface to PopelObjectCollection |
|
array |
toKeyValue(string $keyColumn, string $valueColumn)
Get an associative array representation of the collection The first parameter specifies the column to be used for the key, And the seconf for the value. |
Details
in PropelCollection at line 52
public array
getData()
Get the data in the collection
in PropelCollection at line 62
public
setData(array $data)
Set the data in the collection
in PropelCollection at line 73
public integer
getPosition()
Gets the position of the internal pointer This position can be later used in seek()
in PropelCollection at line 84
public mixed
getFirst()
Move the internal pointer to the beginning of the list And get the first element in the collection
in PropelCollection at line 95
public boolean
isFirst()
Check whether the internal pointer is at the beginning of the list
in PropelCollection at line 106
public mixed
getPrevious()
Move the internal pointer backward And get the previous element in the collection
in PropelCollection at line 122
public mixed
getCurrent()
Get the current element in the collection
in PropelCollection at line 133
public mixed
getNext()
Move the internal pointer forward And get the next element in the collection
in PropelCollection at line 145
public mixed
getLast()
Move the internal pointer to the end of the list And get the last element in the collection
in PropelCollection at line 161
public boolean
isLast()
Check whether the internal pointer is at the end of the list
in PropelCollection at line 177
public boolean
isEmpty()
Check if the collection is empty
in PropelCollection at line 187
public boolean
isOdd()
Check if the current index is an odd integer
in PropelCollection at line 197
public boolean
isEven()
Check if the current index is an even integer
in PropelCollection at line 209
public mixed
get(mixed $key)
Get an element from its key Alias for ArrayObject::offsetGet()
in PropelCollection at line 222
public mixed
pop()
Pops an element off the end of the collection
in PropelCollection at line 238
public mixed
shift()
Pops an element off the beginning of the collection
in PropelCollection at line 255
public integer
prepend(mixed $value)
Prepend one or more elements to the beginning of the collection
in PropelCollection at line 273
public
set(mixed $key, mixed $value)
Add an element to the collection with the given key Alias for ArrayObject::offsetSet()
in PropelCollection at line 285
public mixed
remove(mixed $key)
Removes a specified collection element Alias for ArrayObject::offsetUnset()
in PropelCollection at line 298
public array
clear()
Clears the collection
in PropelCollection at line 309
public boolean
contains(mixed $element)
Whether or not this collection contains a specified element
in PropelCollection at line 320
public mixed
search(mixed $element)
Search an element in the collection
in PropelCollection at line 330
public string
serialize()
in PropelCollection at line 342
public
unserialize(string $data)
in PropelCollection at line 357
public ArrayIterator
getIterator()
Overrides ArrayObject::getIterator() to save the iterator object for internal use e.g.
getNext(), isOdd(), etc.
in PropelCollection at line 366
public ArrayIterator
getInternalIterator()
in PropelCollection at line 380
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.
in PropelCollection at line 392
public
setModel(string $model)
Set the model of the elements in the collection
in PropelCollection at line 402
public string
getModel()
Get the model of the elements in the collection
in PropelCollection at line 412
public string
getPeerClass()
Get the peer class of the elements in the collection
in PropelCollection at line 423
public
setFormatter(PropelFormatter $formatter)
in PropelCollection at line 431
public PropelFormatter
getFormatter()
in PropelCollection at line 442
public PropelPDO
getConnection(string $type = Propel::CONNECTION_READ)
Get a connection object for the database containing the elements of the collection
in PropelCollection at line 462
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>
in PropelCollection at line 481
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>
in PropelCollection at line 500
public array|string
__call(string $name, mixed $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
in PropelCollection at line 518
public string
__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
at line 26
public
save(PropelPDO $con = null)
Save all the elements in the collection
at line 54
public
delete(PropelPDO $con = null)
Delete all the elements in the collection
at line 83
public array
getPrimaryKeys(boolean $usePrefix = true)
Get an array of the primary keys of all the objects in the collection
at line 102
public
fromArray(array $arr)
Populates the collection from an array Uses the object model to force the column types Does not empty the collection before adding the data from the array
at line 141
public array
toArray(string $keyColumn = null, boolean $usePrefix = false)
Get an array representation of the collection This is not an alias for getData(), since it returns a copy of the data
at line 161
public array
getArrayCopy(string $keyColumn = null, boolean $usePrefix = false)
Synonym for toArray(), to provide a similar interface to PopelObjectCollection
at line 183
public array
toKeyValue(string $keyColumn, string $valueColumn)
Get an associative array representation of the collection The first parameter specifies the column to be used for the key, And the seconf for the value.
<code>
$res = $coll->toKeyValue('Id', 'Name');
</code>