Add default for Monitor Name

pull/3122/head
Isaac Connor 2021-02-01 16:43:24 -05:00
parent b71aa4bd97
commit da7d9c3756
1 changed files with 2 additions and 2 deletions

View File

@ -28,7 +28,7 @@ class Monitor extends ZM_Object {
protected $defaults = array(
'Id' => null,
'Name' => array('type'=>'text','filter_regexp'=>'/[^\w\-\.\(\)\:\/ ]/'),
'Name' => array('type'=>'text','filter_regexp'=>'/[^\w\-\.\(\)\:\/ ]/', 'default'=>'Monitor'),
'Notes' => '',
'ServerId' => 0,
'StorageId' => 0,
@ -166,7 +166,7 @@ class Monitor extends ZM_Object {
public function __call($fn, array $args){
if ( count($args) ) {
if ( is_array($this->defaults[$fn]) and $this->defaults[$fn]['type'] == 'set' ) {
$this->{$fn} = is_array($args[0]) ? implode(',',$args[0]) : $args[0];
$this->{$fn} = is_array($args[0]) ? implode(',', $args[0]) : $args[0];
} else {
$this->{$fn} = $args[0];
}