<?php
/**
* MineAdmin is committed to providing solutions for quickly building web applications
* Please view the LICENSE file that was distributed with this source code,
* For the full copyright and license information.
* Thank you very much for using MineAdmin.
*
* @Author X.Mo<root@imoi.cn>
* @Link https://gitee.com/xmo/MineAdmin
*/
declare(strict_types = 1);
namespace Mine\Abstracts;
use Mine\Traits\ServiceTrait;
use Hyperf\Utils\Context;
class AbstractService
{
use ServiceTrait;
public $mapper;
public function setAttributes(array $data)
{
Context::set('attributes', $data);
}
public function __get(string $name)
{
return $this->getAttributes()[$name] ?? '';
}
public function getAttributes(): array
{
return Context::get('attributes', []);
}
}