Source for file INFA_DBMS_DBOBJ.phpclass

Documentation is available at INFA_DBMS_DBOBJ.phpclass

  1. <?php
  2. /**
  3.   * interface file INFA_DBMS_DBOBJ.phpclass
  4.   *
  5.   * @project    Open CSP-Management
  6.   * @package    dbms
  7.   * @category   field
  8.   *
  9.   * @author     Peter Krebs <pitlinz@sourceforge.net>
  10.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  11.   *
  12.   ***/
  13.  
  14.  
  15. /**
  16.   * interface to handle a database connection object
  17.   *
  18.   * @project    Open CSP-Management
  19.   * @package    dbms
  20.   *
  21.   * @author     Peter Krebs <pitlinz@sourceforge.net>
  22.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  23.   * 
  24.   * @since pk-08-01-31
  25.   */
  26. interface INFA_DBMS_DBOBJ
  27. {
  28.  
  29.     // ------------------------------------------------------
  30.     // query methods
  31.     // ------------------------------------------------------
  32.      
  33.     /**
  34.       * generates a query and returns an array of the resultset
  35.       *
  36.       * limit <> a multidimensional array is returned (see queryArray)
  37.       * if limit = 1 a single array is returned (see quickQuery)
  38.       *
  39.       * conditions:
  40.       *     if the column starts with a ? the value is assumed to be an sql statement
  41.       *     else  column=slashedvalue(value) is added to the query
  42.       *
  43.       * @param string $aTable (the table name)
  44.       * @param array $conditions (array(COLUMN => VALUE)) if VALUE does not starts with a '¿' t
  45.       * @param int $offset 
  46.       * @param int $limit (0 is unlimeted)
  47.       * @param string $orderBy (comma seperated list of fields to order)
  48.       * @param boolean $debug 
  49.       *
  50.       * @return array 
  51.       * @access public
  52.       *
  53.       *
  54.       */
  55.     public function getArray($aTable,$conditions=NULL,$offset=0,$limit=0,$orderBy="",$debug=FALSE);
  56.  
  57.     
  58.     // ------------------------------------------------------
  59.     // data manipulation methods
  60.     // ------------------------------------------------------
  61.     
  62.     /**
  63.       * inserts a valueArr into the table
  64.       *
  65.       * inserts a new row out of an array
  66.       * returns the value of the auto_increment field or TRUE
  67.       * in case of an error it returns FALSE
  68.       *
  69.       * @param string $table      name of the table to insert
  70.       * @param array $valueArr   key=>value array
  71.       * @param boolean $debug      show debug information
  72.       * @param string $idFld 
  73.       *
  74.       * @returns int    key of auto-key or TRUE on success FALSE in case of error
  75.       *
  76.       */
  77.     public function insertArray($table,$valueArr,$debug=FALSE,$idFld="")
  78.  
  79.  
  80.     /**
  81.       * replace existing row or insert now if not exists
  82.       *
  83.       * inserts a row or update an existing row
  84.       * all existing values not in $valueArr (assoc)
  85.       * will be handeld by db spezifaction
  86.       * see mysql Doc: {@link http://www.mysql.com/doc/en/REPLACE.html}
  87.       *
  88.       * @param string $table name of the DBTABLE
  89.       * @param array $valueArr value array with FIELDNAME as Index
  90.       * @param boolean $debug show debug information
  91.       *
  92.       * @returns bool TRUE on success FALSE in case of error
  93.       *
  94.       */
  95.     public function replaceArray($table,&$valueArr,$debug=FALSE);
  96.  
  97.     /**
  98.      * updates an existing row
  99.      * 
  100.      * @param string $table name of the DBTABLE
  101.      * @param array $valueArr value array with FIELDNAME as Index
  102.      * @param boolean $debug show debug information
  103.      *
  104.      * @returns bool TRUE on success FALSE in case of error
  105.      *
  106.      */
  107.     public function updateArray($table,&$valueArr,$debug=FALSE);        
  108.  
  109.     /**
  110.      * deletes an existing row where $valueArr are conditions
  111.      * 
  112.      * @param string $table name of the DBTABLE
  113.      * @param array $valueArr value array with FIELDNAME as Index
  114.      * @param boolean $debug show debug information
  115.      *
  116.      * @returns bool TRUE on success FALSE in case of error
  117.      *
  118.      */
  119.     public function deleteArray($table,&$valueArr,$debug=FALSE);        
  120.     
  121. }
  122. ?>

Documentation generated on Thu, 08 Jan 2009 17:44:26 +0100 by phpDocumentor 1.4.0a2