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