Changeset 250

Show
Ignore:
Timestamp:
02/10/07 16:13:02 (2 years ago)
Author:
mikey
Message:

added net.stubbles.rdbms.stubDatabaseResult::free()
renamed net.stubbles.rdbms.stubDatabaseStatement::free() to net.stubbles.rdbms.stubDatabaseStatement::clean()
fix in net.stubbles.rdbms.pdo.stubDatabasePDOStatement::fetchAll() if no $fetchMode set

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/rdbms/pdo/stubDatabasePDOStatement.php

    r194 r250  
    195195     * @see     http://php.net/pdostatement-fetchAll 
    196196     * @see     net.stubbles.rdbms.stubDatabaseResult::fetchAll() 
     197     * @todo    fix handling of $fetchMode together with $driverOptions 
    197198     */ 
    198199    public function fetchAll($fetchMode = null, array $driverOptions = array()) 
    199200    { 
    200         if (null == $fetchMode)
    201             $fetchMode = PDO::FETCH_BOTH; 
    202         } 
    203          
    204         try { 
     201        try
     202            if (null == $fetchMode) { 
     203                return $this->pdoStatement->fetchAll(); 
     204            } 
     205             
    205206            return $this->pdoStatement->fetchAll($fetchMode, ((isset($driverOptions['columnIndex']) == false) ? (null) : ($driverOptions['columnIndex']))); 
    206207        } catch (PDOException $pdoe) { 
     
    253254     * @throws  stubDatabaseException 
    254255     * @see     http://php.net/pdostatement-closeCursor 
    255      * @see     net.stubbles.rdbms.stubDatabaseStatement::free() 
     256     * @see     net.stubbles.rdbms.stubDatabaseResult::free() 
    256257     */ 
    257258    public function free() 
     
    262263            throw new stubDatabaseException($pdoe->getMessage(), $pdoe); 
    263264        } 
     265    } 
     266     
     267    /** 
     268     * releases resources allocated for the specified prepared query 
     269     *  
     270     * Frees up the connection to the server so that other SQL statements may  
     271     * be issued, but leaves the statement in a state that enables it to be  
     272     * executed again. 
     273     * 
     274     * @return  bool  true on success, false on failure 
     275     * @throws  stubDatabaseException 
     276     * @see     net.stubbles.rdbms.stubDatabaseStatement::clean() 
     277     */ 
     278    public function clean() 
     279    { 
     280        $this->free(); 
    264281    } 
    265282} 
  • trunk/src/main/php/net/stubbles/rdbms/stubDatabaseResult.php

    r181 r250  
    7171     */ 
    7272    public function count(); 
     73     
     74    /** 
     75     * releases resources allocated of the result set 
     76     * 
     77     * @return  bool  true on success, false on failure 
     78     * @throws  stubDatabaseException 
     79     */ 
     80    public function free(); 
    7381} 
    7482?> 
  • trunk/src/main/php/net/stubbles/rdbms/stubDatabaseStatement.php

    r194 r250  
    6868     * @throws  stubDatabaseException 
    6969     */ 
    70     public function free(); 
     70    public function clean(); 
    7171} 
    7272?>