Files
kiri-databases/src/Annotation/Set.php
T

40 lines
683 B
PHP
Raw Normal View History

2021-08-17 16:22:18 +08:00
<?php
namespace Database\Annotation;
use Annotation\Attribute;
use Database\Base\Setter;
use Exception;
#[\Attribute(\Attribute::TARGET_METHOD)] class Set extends Attribute
{
/**
* Set constructor.
* @param string $name
*/
2021-08-29 04:06:48 +08:00
public function __construct(string $name)
2021-08-17 16:22:18 +08:00
{
}
/**
2021-08-29 04:06:48 +08:00
* @param static $params
2021-08-17 16:22:18 +08:00
* @param mixed $class
* @param mixed|null $method
* @return bool
2021-08-29 04:06:48 +08:00
* @throws \Kiri\Exception\NotFindClassException
* @throws \ReflectionException
2021-08-17 16:22:18 +08:00
*/
2021-08-29 04:06:48 +08:00
public static function execute(mixed $params, mixed $class, mixed $method = null): bool
2021-08-17 16:22:18 +08:00
{
2021-08-29 04:06:48 +08:00
di(Setter::class)->addSetter($params->name, $class, $method);
2021-08-17 16:22:18 +08:00
return true;
}
}