\SwitchModels
Switch models management class
Synopsis
class SwitchModels
{
- // constants
- const TABLE_MODELS = 'switchmodels';
- const TABLE_SWITCHES = 'switches';
- const TABLE_ONUS = 'pononu';
- const URL_ME = '?module=switchmodels';
- const URL_SWITCHES = '?module=switches';
- const ROUTE_DELETE = 'deletesm';
- const ROUTE_EDIT = 'edit';
- const ROUTE_CREATE = 'createsm';
- const PROUTE_NEWNAME = 'newsm';
- const PROUTE_NEWPORTS = 'newsmp';
- const PROUTE_NEWSNMPTPL = 'newsst';
- const PROUTE_EDITNAME = 'editmodelname';
- const PROUTE_EDITPORTS = 'editports';
- const PROUTE_EDITSNMPTPL = 'editsnmptemplate';
- // members
- protected $modelsDb = '';
- protected $switchesDb = '';
- protected $onuDb = '';
- // methods
- public void __construct()
- protected void initDb()
- protected void initSwitchesDb()
- protected void initOnuDb()
- public void|string create()
- public array getData()
- public void|string delete()
- public void|string update()
- public string renderNavLinks()
- public string renderCreateForm()
- public string renderEditForm()
- public array getAll()
- public array getAllNames()
- public array getSnmpTemplatesAll()
- public string renderList()
Constants
| Name | Value |
|---|---|
| TABLE_MODELS | 'switchmodels' |
| TABLE_SWITCHES | 'switches' |
| TABLE_ONUS | 'pononu' |
| URL_ME | '?module=switchmodels' |
| URL_SWITCHES | '?module=switches' |
| ROUTE_DELETE | 'deletesm' |
| ROUTE_EDIT | 'edit' |
| ROUTE_CREATE | 'createsm' |
| PROUTE_NEWNAME | 'newsm' |
| PROUTE_NEWPORTS | 'newsmp' |
| PROUTE_NEWSNMPTPL | 'newsst' |
| PROUTE_EDITNAME | 'editmodelname' |
| PROUTE_EDITPORTS | 'editports' |
| PROUTE_EDITSNMPTPL | 'editsnmptemplate' |
Members
protected
Methods
protected
- initDb() — Inits database abstraction layer for further usage
- initOnuDb() — Inits ONUs database abstraction layer for further usage
- initSwitchesDb() — Inits switches database abstraction layer for further usage
public
- __construct() — U tome je smisao U tome je ljepota Tko tebe kamenom Liši ga života
- create() — Creates new switch model in database
- delete() — Deletes switch model from database by its ID
- getAll() — Returns array of all available switch models
- getAllNames() — Returns array of all available switch models names as id=>modelName
- getData() — Returns data of switch model by its ID
- getSnmpTemplatesAll() — Returns array of all available snmp model templates as name=>device description
- renderCreateForm() — Returns switch model add form
- renderEditForm() — Renders switch model edit form
- renderList() — Returns list of all available switch models
- update() — Updates existing switch model in database