diff --git a/web/includes/Event.php b/web/includes/Event.php index 430c64202..5199338df 100644 --- a/web/includes/Event.php +++ b/web/includes/Event.php @@ -14,6 +14,10 @@ class Event { } elseif ( is_array( $IdOrRow ) ) { $row = $IdOrRow; } else { + $backTrace = debug_backtrace(); + $file = $backTrace[1]['file']; + $line = $backTrace[1]['line']; + Error("Unknown argument passed to Event Constructor from $file:$line)"); Error("Unknown argument passed to Event Constructor ($IdOrRow)"); return; } @@ -30,6 +34,9 @@ class Event { public function Storage() { return new Storage( isset($this->{'StorageId'}) ? $this->{'StorageId'} : NULL ); } + public function Monitor() { + return new Monitor( isset($this->{'MonitorId'}) ? $this->{'MonitorId'} : NULL ); + } public function __call( $fn, array $args){ if ( array_key_exists( $fn, $this ) ) { return $this->{$fn};