Skip to content

Commit

Permalink
If no group id don't do sql lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac Connor committed Nov 6, 2024
1 parent b78ce0f commit f51f1b4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions web/includes/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ public function depth( $new = null ) {

public function MonitorIds( ) {
if (!property_exists($this, 'MonitorIds')) {
if (!$this->{'Id'}) {
return $this->{'MonitorIds'} = [];
}

if (!isset($monitor_ids_cache[$this->{'Id'}])) {
$monitor_ids_cache[$this->{'Id'}] = dbFetchAll('SELECT `MonitorId` FROM `Groups_Monitors` WHERE `GroupId`=?', 'MonitorId', array($this->{'Id'}));
if (count($this->Children())) {
Expand Down

0 comments on commit f51f1b4

Please sign in to comment.