\SwitchUplinks
Siwtches uplink parameters management class
Synopsis
class SwitchUplinks
{
- // constants
- const TABLE_UPLINKS = 'switchuplinks';
- const URL_SWPROFILE = '?module=switches&edit=';
- const ROUTE_SWID = 'swuplinkswitchid';
- const ROUTE_MEDIA = 'swuplinksmedia';
- const ROUTE_SPEED = 'swuplinksspeed';
- const ROUTE_PORT = 'swuplinksport';
- const ROUTE_EDITINTERFACE = 'editswuplinkparameters';
- const PATH_ICONS = 'skins/';
- // members
- protected integer $switchId = 0;
- protected array $uplinkData = ;
- protected array $mediaTypes = ;
- protected array $mediaIcons = ;
- protected array $speedRates = ;
- protected $messages = '';
- protected $switchUplinks = '';
- protected array $allUplinksData = ;
- // methods
- public void __construct()
- protected void setMediaTypes()
- protected void setSpeedRates()
- protected void initMessages()
- protected void initDatabase()
- protected void setSwitchId()
- protected void loadUplinkData()
- public string renderEditForm()
- public void save()
- public void delete()
- public void flush()
- public string renderSwitchUplinkData()
- public void loadAllUplinksData()
- public int getAllUplinksCount()
- public string getUplinkTinyDesc()
- public int/void getUplinkPort()
Constants
Name | Value |
---|---|
TABLE_UPLINKS | 'switchuplinks' |
URL_SWPROFILE | '?module=switches&edit=' |
ROUTE_SWID | 'swuplinkswitchid' |
ROUTE_MEDIA | 'swuplinksmedia' |
ROUTE_SPEED | 'swuplinksspeed' |
ROUTE_PORT | 'swuplinksport' |
ROUTE_EDITINTERFACE | 'editswuplinkparameters' |
PATH_ICONS | 'skins/' |
Members
protected
- $allUplinksData
—
array
Contains all switches uplinks detailed data as switch=>updata - $mediaIcons
—
array
Contains available media types icons - $mediaTypes
—
array
Contains available media types markers and their names - $messages
—
System message helper placeholder - $speedRates
—
array
Contains typical uplink speed rates - $switchId
—
int
Current instance switch ID - $switchUplinks
—
Switches uplink paramereds DB abstraction placeholder - $uplinkData
—
array
Contains current switch uplink data
Methods
protected
- initDatabase() — Inits dabase abstraction
- initMessages() — Inits system message helper instance for further usage
- loadUplinkData() — Loads current switch uplink data
- setMediaTypes() — Sets available uplink media types
- setSpeedRates() — Sets typical speed rates for uplink ports
- setSwitchId() — Current instance switchId setter
public
- __construct() — Creates new switch uplinks object instance
- delete() — Delete switch uplink data record from database
- flush() — Delete switch uplink data record from database on switch deletion
- getAllUplinksCount() — Returns count of available uplinks data records
- getUplinkPort() — Returns short uplink port or void if not set
- getUplinkTinyDesc() — Returns short uplink parameters text description
- loadAllUplinksData() — Loads all switches uplinks data
- renderEditForm() — Renders uplink parameters editing inputs
- renderSwitchUplinkData() — Renders current instance uplink data in compact format
- save() — Saves switch uplink data into database