fogproject  1.5.9
About: FOG is a Linux-based network computer cloning solution for Windows, Mac OSX and various Linux distributions that ties together a few open-source tools with a PHP-based web interface. FOG doesn’t use any boot disks, or CDs; everything is done via TFTP and PXE.
  Fossies Dox: fogproject-1.5.9.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

powermanagement.class.php
Go to the documentation of this file.
1 <?php
23 {
29  protected $databaseTable = 'powerManagement';
35  protected $databaseFields = array(
36  'id' => 'pmID',
37  'hostID' => 'pmHostID',
38  'min' => 'pmMin',
39  'hour' => 'pmHour',
40  'dom' => 'pmDom',
41  'month' => 'pmMonth',
42  'dow' => 'pmDow',
43  'onDemand' => 'pmOndemand',
44  'action' => 'pmAction',
45  );
51  protected $databaseFieldsRequired = array(
52  'hostID',
53  'min',
54  'hour',
55  'dom',
56  'month',
57  'dow',
58  'action',
59  );
65  protected $additionalFields = array(
66  'hosts',
67  );
75  public function addHost($addArray)
76  {
77  return $this->addRemItem('hosts', (array)$addArray, 'merge');
78  }
86  public function removeHost($removeArray)
87  {
88  return $this->addRemItem('hosts', (array)$removeArray, 'diff');
89  }
95  protected function loadHosts()
96  {
97  $this->set(
98  'hosts',
99  (array)self::getSubObjectIDs(
100  'PowerManagement',
101  array('id' => $this->get('id')),
102  'hostID'
103  )
104  );
105  }
111  public function save()
112  {
113  parent::save();
114  return $this
115  ->assocSetter('PowerManagement', 'host', true)
116  ->load();
117  }
123  public function getActionSelect()
124  {
125  return $this->getManager()->getActionSelect(
126  $this->get('action'),
127  true
128  );
129  }
135  public function getTimer()
136  {
137  $min = trim($this->get('min'));
138  $hour = trim($this->get('hour'));
139  $dom = trim($this->get('dom'));
140  $month = trim($this->get('month'));
141  $dow = trim($this->get('dow'));
142  return new Timer($min, $hour, $dom, $month, $dow);
143  }
149  public function getHost()
150  {
151  return new Host($this->get('hostID'));
152  }
158  public function wakeOnLAN()
159  {
160  $this->getHost()->wakeOnLAN();
161  }
162 }
FOGController\addRemItem
addRemItem($key, $array, $array_type)
Definition: fogcontroller.class.php:823
PowerManagement\getActionSelect
getActionSelect()
Definition: powermanagement.class.php:123
PowerManagement\$additionalFields
$additionalFields
Definition: powermanagement.class.php:65
PowerManagement\wakeOnLAN
wakeOnLAN()
Definition: powermanagement.class.php:158
PowerManagement\$databaseTable
$databaseTable
Definition: powermanagement.class.php:29
PowerManagement\$databaseFields
$databaseFields
Definition: powermanagement.class.php:35
Timer
Definition: timer.class.php:25
PowerManagement\loadHosts
loadHosts()
Definition: powermanagement.class.php:95
PowerManagement\getHost
getHost()
Definition: powermanagement.class.php:149
PowerManagement\addHost
addHost($addArray)
Definition: powermanagement.class.php:75
PowerManagement\$databaseFieldsRequired
$databaseFieldsRequired
Definition: powermanagement.class.php:51
FOGController
Definition: fogcontroller.class.php:29
PowerManagement\getTimer
getTimer()
Definition: powermanagement.class.php:135
PowerManagement
Definition: powermanagement.class.php:23
PowerManagement\save
save()
Definition: powermanagement.class.php:111
FOGController\getManager
getManager()
Definition: fogcontroller.class.php:1039
Host
Definition: host.class.php:23
PowerManagement\removeHost
removeHost($removeArray)
Definition: powermanagement.class.php:86