改名
This commit is contained in:
@@ -29,9 +29,9 @@ class BaseObject implements Configure
|
||||
*/
|
||||
public function __construct($config = [])
|
||||
{
|
||||
// if (!empty($config) && is_array($config)) {
|
||||
// Snowflake::configure($this, $config);
|
||||
// }
|
||||
if (!empty($config) && is_array($config)) {
|
||||
Snowflake::configure($this, $config);
|
||||
}
|
||||
$this->init();
|
||||
}
|
||||
|
||||
|
||||
@@ -152,6 +152,9 @@ class Snowflake
|
||||
public static function configure($object, $config)
|
||||
{
|
||||
foreach ($config as $key => $value) {
|
||||
if (!property_exists($object, $key)) {
|
||||
continue;
|
||||
}
|
||||
$object->$key = $value;
|
||||
}
|
||||
return $object;
|
||||
|
||||
Reference in New Issue
Block a user