_childService[$childServiceName])) { $childService = $this->childService; if (isset($childService[$childServiceName])) { $service = $childService[$childServiceName]; $this->_childService[$childServiceName] = Yii::createObject($service); } else { throw new InvalidConfigException('未找到 [' . $childServiceName . '] 此子模块 ' . get_called_class() . ', 需要先进行配置! '); } } return $this->_childService[$childServiceName] ?? null; } /** * 魔术方法获取子服务 * @Author bing * @DateTime 2021-08-11 16:45:57 * @copyright: Copyright (c) 2020 广东七件事集团 * @param [type] $attr * @return mixed * @throws InvalidConfigException */ public function __get($attr) { return $this->getChildService($attr); } }