Source for file INTEREST.phpclass

Documentation is available at INTEREST.phpclass

  1. <?php
  2. /**
  3.   * openCSP class file INTEREST.phpclass
  4.   *
  5.   * @project Open CSP-Management
  6.   * @package default
  7.   *
  8.   * @author Peter Krebs <pitlinz@users.sourceforge.net>
  9.   * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  10.   *
  11.   * @since pk-22.11.2008
  12.   * @version $Id: INTEREST.phpclass,v 1.2 2008/12/04 16:45:39 peterkrebs Exp $
  13.   */
  14.  
  15.     // ---------------------------------------------------------
  16.     // requirements
  17.     // ---------------------------------------------------------
  18.  
  19.     pcf_require_class('DBMS_SIMPLETREE',"db/");
  20.  
  21. /**
  22.   * openCSP class INTEREST
  23.   *
  24.   * @project Open CSP-Management
  25.   * @package default
  26.   *
  27.   * @author Peter Krebs <pitlinz@users.sourceforge.net>
  28.   * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  29.   *
  30.   * @since pk-22.11.2008
  31.   * @version $Id: INTEREST.phpclass,v 1.2 2008/12/04 16:45:39 peterkrebs Exp $
  32.   */
  33. class INTEREST extends DBMS_SIMPLETREE
  34. {
  35.     // ---------------------------------------------------------------------------
  36.     // constants
  37.     // ---------------------------------------------------------------------------
  38.     
  39.     /**
  40.      * @constant string CLASS_SRC_FILE
  41.      */
  42.     const CLASS_SRC_FILE = __FILE__;
  43.  
  44.     // ---------------------------------------------------------------------------
  45.     // class (static)
  46.     // ---------------------------------------------------------------------------
  47.     
  48.     /*** class vars ------------------------------------------------------ */
  49.     
  50.     protected static $myTreeTable "T_LOOKUP_INTEREST";    
  51.     protected static $myTreeIndexCol "INTR_ID";
  52.     protected static $myTreeParentCol "INTR_PARENT";        
  53.     protected static $myTreeSort "INTR_SORTORDER";
  54.     
  55.     /*** class methods --------------------------------------------------- */
  56.     
  57.     /**
  58.      * factories a node
  59.      *
  60.      * @param int $aId 
  61.      * 
  62.      * @return DBMS_SIMPLETREE 
  63.      */
  64.     public static function &factoryFromId($aId)
  65.     {        
  66.         $obj_ret new INTEREST();
  67.         $obj_ret->setMyTable(self::$myTreeTable);
  68.         $obj_ret->populateFromKeys(array(self::$myTreeIndexCol => intval($aId)));
  69.         return $obj_ret;
  70.     }
  71.     
  72.     /**
  73.      * factories a node
  74.      *
  75.      * @param int $aId 
  76.      * 
  77.      * @return DBMS_SIMPLETREE 
  78.      */
  79.     public static function &factoryFromDBRow($aRow)
  80.     {
  81.         $obj_ret new INTEREST();
  82.         $obj_ret->setMyTable(self::$myTreeTable);
  83.         $obj_ret->setDBRow($aRow,True);
  84.         return $obj_ret;
  85.     }    
  86.     
  87.     // ---------------------------------------------------------------------------
  88.     // object vars
  89.     // ---------------------------------------------------------------------------
  90.     
  91.     /*** compostion --------------------------------------------------- */
  92.     
  93.     /*** attributes  -------------------------------------------------- */
  94.         
  95.     // ---------------------------------------------------------------------------
  96.     // factory / construct
  97.     // ---------------------------------------------------------------------------
  98.     
  99.     // ---------------------------------------------------------------------------
  100.     // getter / setter
  101.     // ---------------------------------------------------------------------------    
  102.  
  103.     /**
  104.      * returns the clienttypeid of this interest
  105.      *
  106.      * @return int 
  107.      */
  108.     public function getCliTypeId()
  109.     {
  110.         return $this->getDBField('CTY_ID');    
  111.     }
  112.     
  113.     public function getName()
  114.     {
  115.         return $this->getDBField('INTR_NAME');
  116.     }
  117.     
  118. }
  119.  
  120. ?>

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