1
0
mirror of synced 2024-12-14 07:06:04 +03:00
doctrine2/manual/docs/Working with objects - Component overview - Table - Finder methods.php

25 lines
624 B
PHP
Raw Normal View History

2006-07-24 01:08:06 +04:00
Doctrine_Table provides basic finder methods. These finder methods are very fast and should be used if you only need to fetch
2006-08-22 02:55:11 +04:00
data from one database table. If you need queries that use several components (database tables) use Doctrine_Connection::query().
<code type="php">
$table = $conn->getTable("User");
// find by primary key
$user = $table->find(2);
if($user !== false)
print $user->name;
// get all users
foreach($table->findAll() as $user) {
print $user->name;
}
// finding by dql
foreach($table->findByDql("name LIKE '%John%'") as $user) {
print $user->created;
}
</code>