2007-04-14 01:49:11 +04:00
|
|
|
You can access the elements of Doctrine_Collection with set() and get() methods or with ArrayAccess interface.
|
2007-04-13 00:52:30 +04:00
|
|
|
|
2007-04-14 01:49:11 +04:00
|
|
|
<code type="php">
|
|
|
|
$table = $conn->getTable("User");
|
|
|
|
|
|
|
|
$users = $table->findAll();
|
|
|
|
|
|
|
|
// accessing elements with ArrayAccess interface
|
|
|
|
|
|
|
|
$users[0]->name = "Jack Daniels";
|
|
|
|
|
|
|
|
$users[1]->name = "John Locke";
|
|
|
|
|
|
|
|
// accessing elements with get()
|
|
|
|
|
|
|
|
print $users->get(1)->name;
|
|
|
|
</code>
|