Include Model and Manufacturer to includes in Monitor.php

This commit is contained in:
Isaac Connor 2021-07-07 09:46:36 -04:00
parent 24a77d7fb3
commit 3bb2b804b3
1 changed files with 18 additions and 2 deletions

View File

@ -1,11 +1,13 @@
<?php <?php
namespace ZM; namespace ZM;
require_once('database.php'); require_once('database.php');
require_once('Server.php');
require_once('Object.php'); require_once('Object.php');
require_once('Control.php'); require_once('Control.php');
require_once('Storage.php');
require_once('Group.php'); require_once('Group.php');
require_once('Manufacturer.php');
require_once('Model.php');
require_once('Server.php');
require_once('Storage.php');
$FunctionTypes = null; $FunctionTypes = null;
@ -658,5 +660,19 @@ class Monitor extends ZM_Object {
function DisableAlarms() { function DisableAlarms() {
$output = $this->AlarmCommand('disable'); $output = $this->AlarmCommand('disable');
} }
function Model() {
if (!$this->{'Model'}) {
$this->{'Model'} = Model::find_one(array('Id'=>$this->ModelId()));
if (!$this->{'Model'}) $this->{'Model'} = new Model();
}
return $this->{'Model'};
}
function Manufacturer() {
if (!$this->{'Manufacturer'}) {
$this->{'Manufacturer'} = Manufacturer::find_one(array('Id'=>$this->ManufacturerId()));
if (!$this->{'Manufacturer'}) $this->{'Manufacturer'} = new Manufacturer();
}
return $this->{'Manufacturer'};
}
} // end class Monitor } // end class Monitor
?> ?>