[
class tree: tangra_lib
] [
index: tangra_lib
] [
all elements
]
tangra_lib
Packages:
tangra_lib
Source for file tangra_module_license.class.php
Documentation is available at
tangra_module_license.class.php
<?php
// $Id$
/**
* Contains class Tangra_Module_License
*
*
@package
tangra_lib
*
@subpackage
modules_manager
*/
/**
* Module license
*
*
@package
tangra_lib
*
@subpackage
modules_manager
*/
class
Tangra_Module_License
extends
Tangra_Class
{
/**
* ID
*
*
@var
integer
*
@internal
*/
private
$id
;
/**
* Name of the license
*
*
@var
string
*
@internal
*/
private
$name
;
/**
* Is license Free and Open Source (FOSS)
*
*
@var
boolean
*
@internal
*/
private
$foss
;
/**
* License HID
*
*
@var
string
*
@internal
*/
private
$hid
;
/**
* Sets ID
*
*
@param
integer
$id
*/
public
function
set_id
(
$id
)
{
tangra_if_not_int_throw_e
(
$id
)
;
$this
->
id
=
$id
;
}
/**
* Gets ID
*
*
@return
integer
*/
public
function
get_id
(
)
{
return
$this
->
id
;
}
/**
* Sets name
*
*
@param
string
$name
*/
public
function
set_name
(
$name
)
{
$this
->
name
=
$name
;
}
/**
* Gets name
*
*
@return
string
*/
public
function
get_name
(
)
{
return
$this
->
name
;
}
/**
* Sets FOSS - Is license Free and Open Source (FOSS)
*
*
@param
boolean
$foss
*/
public
function
set_foss
(
$foss
)
{
$this
->
foss
=
$foss
?
true
:
false
;
}
/**
* Gets FOSS
*
*
@return
boolean
*/
public
function
get_foss
(
)
{
return
$this
->
foss
;
}
/**
* Sets HID
*
*
@param
string
$hid
*/
public
function
set_hid
(
$hid
)
{
if
(
$hid
)
{
if
(
ereg
(
"[a-z0-9_]{1,100}"
,
$hid
))
{
$this
->
hid
=
$hid
;
}
else
{
throw
TE_TCMS_Exception
(
'Invalid hid: '
.
$hid
.
'. Must conform ereg("[a-z0-9_]{1,100}").'
)
;
}
}
else
{
$this
->
hid
=
$hid
;
}
}
/**
* Gets HID
*
*
@return
string
*/
public
function
get_hid
(
)
{
return
$this
->
hid
;
}
}