Changeset 181

Show
Ignore:
Timestamp:
02/01/07 04:57:04 (2 years ago)
Author:
mikey
Message:

added net.stubbles.rdbms.stubDatabaseResult
added methods to net.stubbles.rdbms.stubDatabaseStatement

Files:

Legend:

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

    r170 r181  
    11<?php 
    22/** 
    3  * wrapper around the PDOStatement object 
     3 * Interface for database statements. 
    44 * 
    55 * @author      Frank Kleine <mikey@stubbles.net> 
     
    99stubClassLoader::load('net.stubbles.rdbms.stubDatabaseException'); 
    1010/** 
    11  * wrapper around the PDOStatement object 
     11 * Interface for database statements. 
    1212 * 
    1313 * @package     stubbles 
    1414 * @subpackage  rdbms 
    1515 */ 
    16 interface stubDatabaseStatement extends IteratorAggregate 
     16interface stubDatabaseStatement 
    1717{ 
    18  
     18    /** 
     19     * bind a parameter of a prepared query to the specified variable 
     20     *  
     21     * The binding will be via reference, so it is evaluated at the time when  
     22     * the prepared statement is executed meaning that in opposite to  
     23     * bindValue() the value of the variable at the time of execution will be  
     24     * used, not the value at the time when this method is called. 
     25     * 
     26     * @param   int|string  $param     the order number of the parameter or its name 
     27     * @param   mixed       $variable  the variable to bind to the parameter 
     28     * @param   int|string  $type      optional  type of the parameter 
     29     * @param   int         $length    optional  length of the data type 
     30     * @return  bool        true on success, false on failure 
     31     * @throws  stubDatabaseException 
     32     */ 
     33    public function bindParam($param, &$variable, $type = null, $length = 0); 
     34     
     35    /** 
     36     * bind a value to the parameter of a prepared query 
     37     *  
     38     * In opposite to bindParam() this will use the value as it is at the time 
     39     * when this method is called. 
     40     *  
     41     * @param   int|string  $param  the order number of the parameter or its name 
     42     * @param   mixed       $value  the value to bind 
     43     * @param   int|string  $type   optional  type of the parameter 
     44     * @return  bool        true on success, false on failure 
     45     * @throws  stubDatabaseException 
     46     */ 
     47    public function bindValue($param, $value, $type = null); 
     48     
     49    /** 
     50     * executes a prepared statement 
     51     * 
     52     * @param  array  $values  optional  specifies all necessary information for bindParam() 
     53     *                                   the array elements must use keys corresponding to the  
     54     *                                   number of the position or name of the parameter 
     55     * @return  bool  true on success, false on failure 
     56     * @throws  stubDatabaseException 
     57     */ 
     58    public function execute(array $values = array()); 
     59     
     60    /** 
     61     * releases resources allocated for the specified prepared query 
     62     *  
     63     * Frees up the connection to the server so that other SQL statements may  
     64     * be issued, but leaves the statement in a state that enables it to be  
     65     * executed again. 
     66     * 
     67     * @return  bool  true on success, false on failure 
     68     * @throws  stubDatabaseException 
     69     */ 
     70    public function free(); 
    1971} 
    2072?>