1
0
mirror of synced 2024-12-15 07:36:03 +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;
}
?>