Source for file DBMS_FIELD_AUTINC_KEY.phpclass

Documentation is available at DBMS_FIELD_AUTINC_KEY.phpclass

  1. <?php
  2. /**
  3.   * Class file DBMS_FIELD_AUTINC_KEY.phpclass
  4.   *
  5.   * @project    Open CSP-Management
  6.   * @package    dbms_field
  7.   * @category   int
  8.   *
  9.   * @author     Peter Krebs <p.krebs@a1.net>
  10.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  11.   *
  12.   ***/
  13.  
  14. if (!isset($GLOBALS['OCSP']['DBMSFLD_PATH']|| empty($GLOBALS['OCSP']['DBMSFLD_PATH'])) {
  15.     $GLOBALS['OCSP']['DBMSFLD_PATH']=dirname(__FILE__)."/";
  16. }
  17. require_once $GLOBALS['OCSP']['DBMSFLD_PATH']."DBMS_FIELD_INT.phpclass";
  18.  
  19. /**
  20.   * Class DBMS_FIELD_AUTINC_KEY
  21.   *
  22.   * @project    Open CSP-Management
  23.   * @package    dbms_field
  24.   * @category   int
  25.   *
  26.   * @author     Peter Krebs <p.krebs@lvus.at>
  27.   * @copyright  (c) 2002-2003 by Peter Krebs and Landesverlag Unternehmensservice
  28.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  29.   *
  30.   ***/
  31.     var $className     = "AutoInc Primary Key";
  32.  
  33.     /**
  34.       * source file of the class
  35.       *
  36.       * @var string $classSrcFile 
  37.       * @since pk-05-01-14
  38.       ***/
  39.     var $classSrcFile=__FILE__;
  40.  
  41.  
  42.     // ###########################################################
  43.     // OBJECT SETTINGS METHODS
  44.     // ###########################################################
  45.  
  46.     // ###########################################################
  47.     // FIELD DEFINITION DATA METHODS
  48.     // ###########################################################
  49.  
  50.     /**
  51.       * returns an array of field to bie shown in the edit form
  52.       * by using editTbl_echoForm
  53.       *
  54.       * the array is in the form:
  55.       *
  56.       * <code>
  57.       * [_sectionName_]
  58.       *      [TITLE] -> string
  59.       *      [_rowName_]
  60.       *         [FLDLAB]  (complete html code with <td></td>)
  61.       *         [FLDVAL] (complete html code with <td></td>)
  62.       * </code>
  63.       *
  64.       * @param boolean $debug 
  65.       *
  66.       * @returns array
  67.       *
  68.       * @since pk-06-06-29
  69.       *
  70.       ***/
  71.     function editTbl_getFieldEditArr($debug=FALSE{
  72.         if ($debugechoDebugMethod(__FILE__,get_class($this),"DBMS_FIELD_AUTINC_KEY::editTbl_getFieldEditArr","",0);
  73.         $a_ret=parent::editTbl_getFieldEditArr($debug);
  74.  
  75.         unset($a_ret['COMMON']['FRM_DEFVAL']);
  76.  
  77.         unset($a_ret['VALCHECKS']['FRM_ALLOWNULL']);
  78.         unset($a_ret['VALCHECKS']['FRM_NULLERRMSG']);
  79.         unset($a_ret['VALCHECKS']['NULL2ZERO']);
  80.  
  81.         unset($a_ret['SHOW']['FLD_ALLOW']);
  82.         unset($a_ret['LAYOUT']['UNIT']);
  83.  
  84.  
  85.         return $a_ret;
  86.     }
  87.  
  88.     /**
  89.       * saves the form desc
  90.       *
  91.       * @returns boolean
  92.       *
  93.       *
  94.       ***/
  95.     function save({
  96.         $ret parent::save();
  97.  
  98.         $this->defaultValue = "";
  99.  
  100.         $this->allowNull    = TRUE// as it should be set by the database
  101.         $this->null2zero    = FALSE;
  102.  
  103.         $this->enableNew        = FALSE;
  104.         $this->enableEdit       = FALSE;
  105.         $this->enableCopy       = FALSE;
  106.         $this->enableEditIfEmptyFALSE;
  107.  
  108.         $this->unit         = "";
  109.  
  110.         return $ret;
  111.     }
  112.  
  113.     // ###########################################################
  114.     // OBJECT HTML FORM METHODS
  115.     // ###########################################################
  116.  
  117.     // ################################################
  118.     // SEARCH FORM METHODS
  119.     // ################################################
  120.  
  121.     /**
  122.       * returns the html code for the search compare type select
  123.       *
  124.       * @param string $arrName 
  125.       *
  126.       * @returns string
  127.       *
  128.       ***/
  129.     function getSearchCompTypes($arrName{
  130.         $ret ="<select name=\"".$arrName."[".$this->myName."][COMPTYPE]\">";
  131.         $ret.="  <option value=\"=\">=</option>";
  132.         $ret.="</select>";
  133.         return $ret;
  134.     }
  135.  
  136.  
  137.     // ###########################################################
  138.     // OBJECT VALUE CHECK/RETURN METHODS
  139.     // ###########################################################
  140.  
  141.     /**
  142.       * returns the field value
  143.       *
  144.       * @param  string  $aValue     the value
  145.       * @param  array   $err        error array
  146.       * @param  string  $arrName    name of the array to access fieldsarray  gloabl ${$arrName}
  147.       * @param  bool    $debug 
  148.       *
  149.       * @return string 
  150.       *
  151.       * @todo use sequence for oracle
  152.       *
  153.       ***/
  154.     function getValue($aValue,&$err,$arrName="DBVAL",$debug=FALSE{
  155.         $debug=($debug || $this->fldDebug);
  156.         if ($debugechoDebugMethod(__FILE__,get_class($this),"DBMS_FIELD_AUTINC_KEY::getValue($aValue,...)");
  157.  
  158.         $this->dbDesc['AUTO_INCREMENT']=TRUE;        
  159.         switch ($this->myForm->getFrmMode())
  160.         {
  161.             case FRM_MODE_NEW:
  162.             case FRM_MODE_COPY:
  163.                 return NULL;
  164.             default:
  165.                 return parent::getValue($aValue,&$err,$arrName,$debug);                        
  166.         }
  167.     }
  168.  
  169.  
  170.  
  171. }
  172. ?>

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