1
0
mirror of synced 2024-12-15 07:36:03 +03:00
doctrine2/manual/docs/Working with objects - Component overview - Collection - Accessing elements.php
2007-04-13 21:49:11 +00:00

18 lines
382 B
PHP

You can access the elements of Doctrine_Collection with set() and get() methods or with ArrayAccess interface.
<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>