2006-07-24 01:08:06 +04:00
|
|
|
<?php
|
2006-08-22 02:51:27 +04:00
|
|
|
$table = $conn->getTable("User");
|
2006-07-24 01:08:06 +04:00
|
|
|
|
|
|
|
$table->setAttribute(Doctrine::ATTR_FETCHMODE, Doctrine::FETCH_IMMEDIATE);
|
|
|
|
|
|
|
|
$users = $table->findAll();
|
|
|
|
|
|
|
|
// or
|
|
|
|
|
2006-08-22 02:51:27 +04:00
|
|
|
$users = $conn->query("FROM User-I"); // immediate collection
|
2006-07-24 01:08:06 +04:00
|
|
|
|
|
|
|
foreach($users as $user) {
|
|
|
|
print $user->name;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$table->setAttribute(Doctrine::ATTR_FETCHMODE, Doctrine::FETCH_LAZY);
|
|
|
|
|
|
|
|
$users = $table->findAll();
|
|
|
|
|
|
|
|
// or
|
|
|
|
|
2006-08-22 02:51:27 +04:00
|
|
|
$users = $conn->query("FROM User-L"); // lazy collection
|
2006-07-24 01:08:06 +04:00
|
|
|
|
|
|
|
foreach($users as $user) {
|
|
|
|
print $user->name;
|
|
|
|
}
|
|
|
|
|
|
|
|
$table->setAttribute(Doctrine::ATTR_FETCHMODE, Doctrine::FETCH_BATCH);
|
|
|
|
|
|
|
|
$users = $table->findAll();
|
|
|
|
|
|
|
|
// or
|
|
|
|
|
2006-08-22 02:51:27 +04:00
|
|
|
$users = $conn->query("FROM User-B"); // batch collection
|
2006-07-24 01:08:06 +04:00
|
|
|
|
|
|
|
foreach($users as $user) {
|
|
|
|
print $user->name;
|
|
|
|
}
|
|
|
|
|
|
|
|
$table->setAttribute(Doctrine::ATTR_FETCHMODE, Doctrine::FETCH_OFFSET);
|
|
|
|
|
|
|
|
$users = $table->findAll();
|
|
|
|
|
|
|
|
// or
|
|
|
|
|
2006-08-22 02:51:27 +04:00
|
|
|
$users = $conn->query("FROM User-O"); // offset collection
|
2006-07-24 01:08:06 +04:00
|
|
|
|
|
|
|
foreach($users as $user) {
|
|
|
|
print $user->name;
|
|
|
|
}
|
|
|
|
?>
|