From 3bb2b804b3a69f158e54149dc9e707a96cd611b0 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 7 Jul 2021 09:46:36 -0400 Subject: [PATCH] Include Model and Manufacturer to includes in Monitor.php --- web/includes/Monitor.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/web/includes/Monitor.php b/web/includes/Monitor.php index ad3e95a0d..4f9450a3d 100644 --- a/web/includes/Monitor.php +++ b/web/includes/Monitor.php @@ -1,11 +1,13 @@ 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 ?>