Ignore:
Timestamp:
Jan 20, 2012, 3:32:02 PM (13 years ago)
Author:
chronos
Message:
  • Přidáno: Model pro NetworkSegment.
  • Upraveno: Přepracován model systém pro načítání modelů modulů.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Network/Network.php

    r377 r378  
    7878    $this->AddPropertyString('IPv6');
    7979    $this->AddPropertyString('ExternalIP');
    80     $this->AddPropertyOneToMany('Device', 'Device');
     80    $this->AddPropertyOneToMany('Device', 'NetworkDevice');
    8181    $this->AddPropertyBoolean('Online');
    8282    $this->AddPropertyDateTime('LastOnline');
     
    153153  }
    154154}
     155
     156class NetworkSegment extends Model
     157{
     158  function __construct($Database, $System)
     159  {
     160    parent::__construct($Database, $System);
     161    $this->Name = 'NetworkSegment';
     162    $this->AddPropertyString('Name');
     163    $this->AddPropertyInteger('Price');
     164    $this->AddPropertyOneToMany('Parent', 'NetworkSegment');
     165    $this->AddPropertyInteger('Users');
     166    $this->AddPropertyInteger('Consumption');
     167    $this->AddPropertyInteger('UsersOverheads');
     168  }
     169}
     170
    155171
    156172class EmailView extends ViewForm
     
    221237    $this->Description = 'Network device, interface and interconnection management';
    222238    $this->Dependencies = array('User', 'Member');
    223     $this->Models = array('NetworkDevice', 'NetworkDeviceType', 'NetworkInterface',
    224       'NetworkInterfaceType', 'NetworkPoint', 'NetworkLink', 'NetworkSubnet');
     239    $this->SupportedModels = array('NetworkDevice', 'NetworkDeviceType', 'NetworkInterface',
     240      'NetworkInterfaceType', 'NetworkPoint', 'NetworkLink', 'NetworkSubnet',
     241      'NetworkSegment');
    225242  }
    226243 
Note: See TracChangeset for help on using the changeset viewer.