mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-05-24 14:36:09 -04:00
Add Secondary Storage support to the Event object
This commit is contained in:
@@ -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