2007-04-14 01:49:11 +04:00
|
|
|
Deleting records in Doctrine is handled by Doctrine_Record::delete(), Doctrine_Collection::delete() and
|
|
|
|
Doctrine_Connection::delete() methods.
|
2007-04-13 00:52:30 +04:00
|
|
|
|
2007-04-14 01:49:11 +04:00
|
|
|
<code type="php">
|
|
|
|
$table = $conn->getTable("User");
|
|
|
|
|
|
|
|
$user = $table->find(2);
|
|
|
|
|
|
|
|
// deletes user and all related composite objects
|
|
|
|
if($user !== false)
|
|
|
|
$user->delete();
|
|
|
|
|
|
|
|
|
|
|
|
$users = $table->findAll();
|
|
|
|
|
|
|
|
|
|
|
|
// delete all users and their related composite objects
|
|
|
|
$users->delete();
|
|
|
|
</code>
|