Working with objects - Dealing with relations - Deleting related records.php 307 Bytes
Newer Older
hansbrix's avatar
hansbrix committed
1 2 3 4 5 6 7 8 9 10 11 12
You can delete related records individually be calling delete() on each record. If you want to delete a whole record graph just call
delete on the owner record.

<code type="php">
$user->Email->delete();

$user->Phonenumber[3]->delete();

// deleting user and all related objects:

$user->delete();
</code>