mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-10-24 07:18:22 -04:00
Add Secondary Storage support to the Event object
This commit is contained in:
1 parent
afa02e436d
commit
58851d23d2
1 file changed
+14
@@ -12,6 +12,7 @@ class Event {
|
||||
'Name',
|
||||
'MonitorId',
|
||||
'StorageId',
|
||||
'SecondaryStorageId',
|
||||
'Name',
|
||||
'Cause',
|
||||
'StartTime',
|
||||
@@ -85,6 +86,19 @@ class Event {
|
||||
return $this->{'Storage'};
|
||||
}
|
||||
|
||||
public function SecondaryStorage( $new = null ) {
|
||||
if ( $new ) {
|
||||
$this->{'SecondaryStorage'} = $new;
|
||||
}
|
||||
if ( ! ( array_key_exists('SecondaryStorage', $this) and $this->{'SecondaryStorage'} ) ) {
|
||||
if ( isset($this->{'SecondaryStorageId'}) and $this->{'SecondaryStorageId'} )
|
||||
$this->{'SecondaryStorage'} = Storage::find_one(array('Id'=>$this->{'SecondaryStorageId'}));
|
||||
if ( ! ( array_key_exists('SecondaryStorage', $this) and $this->{'SecondaryStorage'} ) )
|
||||
$this->{'SecondaryStorage'} = new Storage(NULL);
|
||||
}
|
||||
return $this->{'SecondaryStorage'};
|
||||
}
|
||||
|
||||
public function Monitor() {
|
||||
if ( isset($this->{'MonitorId'}) ) {
|
||||
$Monitor = Monitor::find_one(array('Id'=>$this->{'MonitorId'}));
|
||||
|
||||
Reference in new issue
Block a user