add clear

This commit is contained in:
as2252258@163.com
2019-07-19 18:09:42 +08:00
parent b24d18dc55
commit e44b1c0989
+20
View File
@@ -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;
}
}