Cuts all references the entity has to other entities and removes the entity
from the instance pool.
Note: The entity is no longer useable after free() has been called. Any operations
done with the entity afterwards can lead to unpredictable results.
/** * Frees the resources used by the collection. * WARNING: After invoking free() the collection is no longer considered to * be in a useable state. Subsequent usage may result in unexpected behavior. * * @return void */ public function free($deep = false) { foreach ($this->getData() as $key => $record) { if (!$record instanceof Doctrine_Null) { $record->free($deep); } } $this->data = array(); if ($this->reference) { $this->reference->free($deep); $this->reference = null; } }