add clear
This commit is contained in:
@@ -396,4 +396,24 @@ class Config
|
||||
return $this->key;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $configs
|
||||
* @return $this
|
||||
*/
|
||||
public function setConfigs(array $configs)
|
||||
{
|
||||
foreach ($configs as $key => $val) {
|
||||
if (empty($val) || is_array($val)) {
|
||||
continue;
|
||||
}
|
||||
if (!property_exists($this, $key)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->$key = $val;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user