1
0
mirror of synced 2024-12-13 14:56:01 +03:00
doctrine2/manual/codes/Basic Components - Table - Finder methods.php

22 lines
347 B
PHP

<?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;
}
?>