1
0
mirror of synced 2024-12-14 07:06:04 +03:00
doctrine2/manual/docs/Working with objects - Component overview - Record - Deleting records.php

20 lines
446 B
PHP
Raw Normal View History

2006-07-24 01:08:06 +04:00
Deleting records in Doctrine is handled by Doctrine_Record::delete(), Doctrine_Collection::delete() and
2006-08-22 02:55:11 +04:00
Doctrine_Connection::delete() methods.
<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>