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

Source for file tangra_module_license.class.php

Documentation is available at tangra_module_license.class.php

  1. <?php
  2.  
  3. // $Id$
  4.  
  5. /**
  6.  * Contains class Tangra_Module_License
  7.  *
  8.  * @package  tangra_lib
  9.  * @subpackage  modules_manager
  10.  */
  11.  
  12.  
  13. /**
  14.  * Module license
  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.      * Name of the license
  28.      *
  29.      * @var string 
  30.      * @internal
  31.      */
  32.     private $name;
  33.     /**
  34.      * Is license Free and Open Source (FOSS)
  35.      *
  36.      * @var boolean 
  37.      * @internal
  38.      */
  39.     private $foss;
  40.     /**
  41.      * License HID
  42.      *
  43.      * @var string 
  44.      * @internal
  45.      */
  46.     private $hid;
  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 name
  73.      *
  74.      * @param string $name 
  75.      */
  76.     public function set_name($name{
  77.         $this->name = $name;
  78.     }
  79.  
  80.  
  81.     /**
  82.      * Gets name
  83.      *
  84.      * @return string 
  85.      */
  86.     public function get_name({
  87.         return $this->name;
  88.     }
  89.  
  90.  
  91.     /**
  92.      * Sets FOSS - Is license Free and Open Source (FOSS)
  93.      *
  94.      * @param boolean $foss 
  95.      */
  96.     public function set_foss($foss{
  97.         $this->foss = $foss true false;
  98.     }
  99.  
  100.  
  101.     /**
  102.      * Gets FOSS
  103.      *
  104.      * @return boolean 
  105.      */
  106.     public function get_foss({
  107.         return $this->foss;
  108.     }
  109.  
  110.  
  111.     /**
  112.      * Sets HID
  113.      *
  114.      * @param string $hid 
  115.      */
  116.     public function set_hid($hid{
  117.         if ($hid{
  118.             if (ereg("[a-z0-9_]{1,100}"$hid)) {
  119.                 $this->hid = $hid;
  120.             else {
  121.                 throw TE_TCMS_Exception('Invalid hid: '.$hid.'. Must conform ereg("[a-z0-9_]{1,100}").');
  122.             }
  123.         else {
  124.             $this->hid = $hid;
  125.         }
  126.     }
  127.  
  128.  
  129.     /**
  130.      * Gets HID
  131.      *
  132.      * @return string 
  133.      */
  134.     public function get_hid({
  135.         return $this->hid;
  136.     }
  137. }