Files
kiri-databases/src/Note/Get.php
T

45 lines
698 B
PHP
Raw Normal View History

2021-08-17 16:22:18 +08:00
<?php
2021-11-30 15:10:01 +08:00
namespace Database\Note;
2021-08-17 16:22:18 +08:00
use Attribute;
use Database\Base\Getter;
use Exception;
/**
* Class Get
2021-11-30 15:10:01 +08:00
* @package Note\Model
2021-08-17 16:22:18 +08:00
*/
2021-11-30 15:10:01 +08:00
#[Attribute(Attribute::TARGET_METHOD)] class Get extends \Note\Attribute
2021-08-17 16:22:18 +08:00
{
/**
* Get constructor.
* @param string $name
*/
public function __construct(public string $name)
{
}
2021-08-29 04:06:48 +08:00
/**
* @param static $params
* @param mixed $class
* @param mixed|null $method
* @return bool
* @throws \Kiri\Exception\NotFindClassException
* @throws \ReflectionException
*/
2021-08-29 05:53:45 +08:00
public function execute(mixed $class, mixed $method = null): bool
2021-08-17 16:22:18 +08:00
{
2021-08-29 05:53:45 +08:00
di(Getter::class)->addGetter($this->name, $class, $method);
2021-08-17 16:22:18 +08:00
return true;
}
}