mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-05-24 14:36:09 -04:00
add Parent and Parents functions
This commit is contained in:
@@ -288,6 +288,23 @@ $group_options[$Group->Id()] = str_repeat( ' ', $depth ) . $Group->Name();
|
||||
return $monitor_id;
|
||||
}
|
||||
|
||||
public function Parent( ) {
|
||||
if ( $this->{'ParentId'} ) {
|
||||
return new Group($this->{'ParentId'});
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function Parents() {
|
||||
$Parents = array();
|
||||
$Parent = $this->Parent();
|
||||
while( $Parent ) {
|
||||
array_unshift($Parents, $Parent);
|
||||
$Parent = $Parent->Parent();
|
||||
}
|
||||
return $Parents;
|
||||
}
|
||||
|
||||
} # end class Group
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user