Changeset 4512

Show
Ignore:
Timestamp:
06/12/08 19:00:41 (13 months ago)
Author:
romanb
Message:

Added second parameter = true to Collection::delete(). Also added Collection::clear(), a basic missing collectin method, and some doc blocks.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/0.11/lib/Doctrine/Collection.php

    r4401 r4512  
    850850     * @return Doctrine_Collection 
    851851     */ 
    852     public function delete(Doctrine_Connection $conn = null) 
     852    public function delete(Doctrine_Connection $conn = null, $clearColl = true) 
    853853    { 
    854854        if ($conn == null) { 
     
    864864 
    865865        $conn->commit(); 
    866  
    867         $this->data = array(); 
     866         
     867        if ($clearColl) { 
     868            $this->clear(); 
     869        } 
    868870         
    869871        return $this; 
    870872    } 
    871  
    872  
     873     
     874    /** 
     875     * Clears the collection. 
     876     * 
     877     * @return void 
     878     */ 
     879    public function clear() 
     880    { 
     881        $this->data = array(); 
     882    } 
     883 
     884    /** 
     885     * Frees the resources used by the collection. 
     886     * WARNING: After invoking free() the collection is no longer considered to 
     887     * be in a useable state. Subsequent usage may result in unexpected behavior. 
     888     * 
     889     * @return void 
     890     */ 
    873891    public function free($deep = false) 
    874892    {