BaseService.php 449 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace addons\QiJuhe\common\service;
  3. use yii\base\BaseObject;
  4. class BaseService extends BaseObject
  5. {
  6. public $error;
  7. public function __construct($config = [])
  8. {
  9. foreach ($config as $key => $val) {
  10. if (property_exists($this, $key)) {
  11. $this->{$key} = $val;
  12. }
  13. }
  14. }
  15. public function error($msg): bool
  16. {
  17. $this->error = $msg;
  18. return false;
  19. }
  20. }