1
0
mirror of synced 2024-12-13 22:56:04 +03:00
doctrine2/manual/codes/Basic Components - Table - Finder methods.php
2006-07-23 21:08:06 +00:00

21 lines
385 B
PHP

<?php
$table = $session->getTable("User");
// find by primary key
try {
$user = $table->find(2);
} catch(Doctrine_Find_Exception $e) {
print "Couldn't find user";
}
// get all users
foreach($table->findAll() as $user) {
print $user->name;
}
// finding by sql
foreach($table->findBySql("name LIKE '%John%'") as $user) {
print $user->created;
}
?>