[
class tree: tangra_lib
] [
index: tangra_lib
] [
all elements
]
tangra_lib
Packages:
tangra_lib
Source for file tangra_module.class.php
Documentation is available at
tangra_module.class.php
<?php
// $Id$
/**
* Contains class Tangra_Module
*
*
@package
tangra_lib
*
@subpackage
modules_manager
*/
/**
* Tangra Module Class
*
*
@package
tangra_lib
*
@subpackage
modules_manager
*/
class
Tangra_Module
extends
Tangra_Class
{
/**
* ID of the module
*
*
@var
integer
*
@internal
*/
private
$id
;
/**
* HID (human id) of the module. e.g. admin_panel
*
*
@var
string
*
@internal
*/
private
$hid
;
/**
* Short description about module
*
*
@var
string
*
@internal
*/
private
$description
;
/**
* Email address of maintainer of the module
*
*
@var
string
*
@internal
*/
private
$maintainer
;
/**
* URL address of web page that contain more information about module
*
*
@var
string
*
@internal
*/
private
$url
;
/**
* ID of the license under which module is released
*
*
@var
integer
*
@internal
*/
private
$license
;
/**
* Sets module ID
*
*
@param
integer
$id
*/
public
function
set_id
(
$id
)
{
tangra_if_not_int_throw_e
(
$id
)
;
$this
->
id
=
$id
;
}
/**
* Gets module id
*
*
@return
integer
*/
public
function
get_id
(
)
{
return
$this
->
id
;
}
/**
* Sets module HID
*
*
@param
string
$hid
Must be alphanumeric, starting with letter, underscore allowed, 100 characters max
*/
public
function
set_hid
(
$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}").'
)
;
}
}
/**
* Gets module HID
*
*
@return
unknown
*/
public
function
get_hid
(
)
{
return
$this
->
hid
;
}
/**
* Sets module description
*
*
@param
string
$description
*/
public
function
set_description
(
$description
)
{
$this
->
description
=
$description
;
}
/**
* Gets module description
*
*
@return
unknown
*/
public
function
get_description
(
)
{
return
$this
->
description
;
}
/**
* Sets module maintainer email
*
*
@param
string
$maintainer
Valid email address
*/
public
function
set_maintainer
(
$maintainer
)
{
//TODO check if maintainer field comforms RFC822, i.e. name <email address>
$this
->
maintainer
=
$maintainer
;
}
/**
* Gets maintainer
*
*
@return
string
*/
public
function
get_maintainer
(
)
{
return
$this
->
maintainer
;
}
/**
* Sets URL address of web page that contain more information about module
*
*
@param
string
$url
*/
public
function
set_url
(
$url
)
{
$this
->
url
=
$url
;
}
/**
* Gets URL address of web page that contain more information about module
*
*
@return
string
*/
public
function
get_url
(
)
{
return
$this
->
url
;
}
/**
* Sets ID of the license under which module is released
*
*
@param
integer
$license
*/
public
function
set_license
(
$license
)
{
tangra_if_not_int_throw_e
(
$license
)
;
$this
->
license
=
$license
;
}
/**
* Gets ID of the license under which module is released
*
*
@return
integer
*/
public
function
get_license
(
)
{
return
$this
->
license
;
}
}