1
0
mirror of synced 2024-12-14 23:26:04 +03:00
doctrine2/manual/codes/Basic Components - Record - Deleting records.php
2006-07-23 21:08:06 +00:00

21 lines
349 B
PHP

<?php
$table = $session->getTable("User");
try {
$user = $table->find(2);
} catch(Doctrine_Find_Exception $e) {
print "Couldn't find user";
}
// deletes user and all related composite objects
$user->delete();
$users = $table->findAll();
// delete all users and their related composite objects
$users->delete();
?>