tangra logo
   
[ class tree: tangra_lib ] [ index: tangra_lib ] [ all elements ]
 

Source for file tangra_module_category.class.php

Documentation is available at tangra_module_category.class.php

  1. <?php
  2.  
  3. // $Id$
  4.  
  5. /**
  6.  * Contains class Tangra_Module_Category
  7.  *
  8.  * @package  tangra_lib
  9.  * @subpackage  modules_manager
  10.  */
  11.  
  12.  
  13. /**
  14.  * Tangra module category
  15.  *
  16.  * @package  tangra_lib
  17.  * @subpackage  modules_manager
  18.  */
  19.     /**
  20.      * ID
  21.      *
  22.      * @var integer 
  23.      * @internal
  24.      */
  25.     private $id;
  26.     /**
  27.      * HID (human id)
  28.      *
  29.      * @var string 
  30.      * @internal
  31.      */
  32.     private $hid;
  33.     /**
  34.      * Name of the category
  35.      *
  36.      * @var string 
  37.      * @internal
  38.      */
  39.     private $name;
  40.     /**
  41.      * Enter description here...
  42.      *
  43.      * @var unknown_type 
  44.      * @internal
  45.      */
  46.     private $description;
  47.  
  48.  
  49.     /**
  50.      * Sets ID
  51.      *
  52.      * @param integer $id 
  53.      */
  54.     public function set_id($id{
  55.         tangra_if_not_int_throw_e($id);
  56.  
  57.         $this->id = $id;
  58.     }
  59.  
  60.  
  61.     /**
  62.      * Gets ID
  63.      *
  64.      * @return integer 
  65.      */
  66.     public function get_id({
  67.         return $this->id;
  68.     }
  69.  
  70.  
  71.     /**
  72.      * Sets HID
  73.      *
  74.      * @param string $hid Must be alphanumeric, starting with letter, underscore allowed, 100 characters max
  75.      */
  76.     public function set_hid($hid{
  77.         if (ereg("[a-z0-9_]{1,100}"$hid)) {
  78.             $this->hid = $hid;
  79.         else {
  80.             throw TE_TCMS_Exception('Invalid hid: '.$hid.'. Must conform ereg("[a-z0-9_]{1,100}").');
  81.         }
  82.     }
  83.  
  84.  
  85.     /**
  86.      * Gets HID
  87.      *
  88.      * @return string 
  89.      */
  90.     public function get_hid({
  91.         return $this->hid;
  92.     }
  93.  
  94.  
  95.     /**
  96.      * Sets name of the category
  97.      *
  98.      * @param string $name 
  99.      */
  100.     public function set_name($name{
  101.         $this->name = $name;
  102.     }
  103.  
  104.  
  105.     /**
  106.      * Gets name of the category
  107.      *
  108.      * @return string 
  109.      */
  110.     public function get_name({
  111.         return $this->name;
  112.     }
  113.  
  114.  
  115.     /**
  116.      * Sets description
  117.      *
  118.      * @param string $description 
  119.      */
  120.     public function set_description($description{
  121.         $this->description = $description;
  122.     }
  123.  
  124.  
  125.     /**
  126.      * Gets description
  127.      *
  128.      * @return unknown 
  129.      */
  130.     public function get_description({
  131.         return $this->description;
  132.     }
  133. }