Source for file INFA_DBMS_TABLEOBJ.phpclass

Documentation is available at INFA_DBMS_TABLEOBJ.phpclass

  1. <?php
  2. /**
  3.   * interface file INFA_DBMS_TABLEOBJ.phpclass
  4.   *
  5.   * @project    Open CSP-Management
  6.   * @package    dbms_field
  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 table 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. {
  27.  
  28.     // ---------------------------------------------------
  29.     // database values
  30.     // ---------------------------------------------------    
  31.         
  32.     /**
  33.       *    returns an array of db default values
  34.       *
  35.       * @param boolean     $debug 
  36.       *
  37.       * @return array 
  38.       *
  39.       */
  40.     public function getDefaults($debug=FALSE);     
  41.  
  42.     // ---------------------------------------------------
  43.     // data manipulation
  44.     // ---------------------------------------------------    
  45.     
  46.     /**
  47.       * returns a field => value array
  48.       *
  49.       * used also in insert and update statements
  50.       *
  51.       * make sure to not include some special values
  52.       * and object columns are serialised
  53.       *
  54.       * @param boolean $withoutNull if True null values are not added to the array
  55.       * @param boolean $debug 
  56.       * @param boolean $withoutOV if False and $this->hasObjVals() the object value array is added with index __OCSP_OBJ_VALS__
  57.       * @param boolean $fldAutoPopulate 
  58.       * 
  59.       * @returns array
  60.       *
  61.       */
  62.     function getDBRow($withoutNull=True,$debug=False,$withoutOV=False,$fldAutoPopulate=True)
  63.  
  64.     /**
  65.       * sets a database row to the object fields
  66.       *
  67.       * sets each key (=columname) value
  68.       *
  69.       * if $row['__OCSP_OBJ_VALS__'] isset and an array this values are set as object values
  70.       * else if $asPopulated object values are loaded
  71.       *
  72.       * @param  array $row            the row form a select * from DBMS_TABLEOBJ::myTable
  73.       * @param  boolean $asPopulated    set populateTS as if the object has been populated
  74.       * @param  boolean $debug 
  75.       *
  76.       * @return boolean 
  77.       *
  78.       */
  79.     function setDBRow($row,$asPopulated=True,$debug=False);     
  80.     
  81.     /**
  82.       * save the Object
  83.       *
  84.       * @param boolean   $debug  SHOW DEBUG INFO
  85.       *
  86.       * @returns mixed
  87.       *
  88.       */
  89.     function dbSave($debug=FALSE)
  90.         
  91.     /**
  92.       * inserts a new row to the table
  93.       *
  94.       * @param boolean   $debug  show debug info
  95.       *
  96.       * @return int   returns the autoIncFld ID if exists or 1 on success
  97.       *
  98.       */
  99.     function dbInsert($debug=FALSE);    
  100.     
  101.     /**
  102.       * replaces a row in the table
  103.       *
  104.       * if the object has not been populated (!$this->populateTS)
  105.       * FALSE is returned
  106.       *
  107.       * @param boolean $debug  show debug info
  108.       * @param boolean $ignorPopulated (if false the table MUST have been populated)
  109.       *
  110.       * @return boolean 
  111.       * 
  112.       */
  113.     function dbReplace($debug=FALSE,$ignorPopulated=FALSE);   
  114.     
  115.     /**
  116.       * deletes the row from the database
  117.       *
  118.       * @param boolean $backupData 
  119.       * @param boolean $debug 
  120.       *
  121.       * @returns boolean
  122.       *
  123.       */
  124.     function dbDelete($backupData=FALSE,$debug=FALSE);
  125.     
  126.     // ---------------------------------------------------
  127.     // database row getter / setter
  128.     // ---------------------------------------------------        
  129.     
  130.     
  131.     
  132.     // --------------- linked tables (joins) -------------
  133.     
  134.     /**
  135.      * sets the row of an other table
  136.      * 
  137.      * this method is used to cache form values of other tables
  138.      * which are joined in to $this->myTable
  139.      * 
  140.      * this rows must be considert in insert,update,delete
  141.      * 
  142.      * possible commands are
  143.      * - _OCSP_DBCMD_INSERT_  (insert a new row)
  144.      * - _OCSP_DBCMD_REPLACE_ (update an existing row or insert if not exists)
  145.      * - _OCSP_DBCMD_UPDATE_  (update an existing row)
  146.      * - _OCSP_DBCMD_DELETE_  (delete an existing row)
  147.      *
  148.      * @param string $tblName 
  149.      * @param string $dbCmd 
  150.      * @param array $aRow 
  151.      * @param boolean $debug 
  152.      * 
  153.      */
  154.     function setLinkedTableRow($tblName,$dbCmd,$aRow,$debug=FALSE);
  155.     
  156. }
  157. ?>

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