1
0
mirror of synced 2024-12-14 07:06:04 +03:00
doctrine2/manual/docs/Basic Components - Collection - Deleting collection.php

10 lines
605 B
PHP
Raw Normal View History

2006-07-24 01:08:06 +04:00
Doctrine Collections can be deleted in very same way is Doctrine Records you just call delete() method.
As for all collections Doctrine knows how to perform single-shot-delete meaning it only performs one
database query for the each collection.
<br \> <br \>
For example if we have collection of users which own [0-*] phonenumbers. When deleting the collection
of users doctrine only performs two queries for this whole transaction. The queries would look something like:
<br \><br \>
DELETE FROM user WHERE id IN (1,2,3, ... ,N)<br \>
DELETE FROM phonenumber WHERE id IN (1,2,3, ... ,M)<br \>