free() public method

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.
public free ( boolean $deep = false )
$deep boolean whether to free also the related components
Exemplo n.º 1
0
 /**
  * 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;
     }
 }