Files
kiri-core/Annotation/Model/Get.php
T

50 lines
774 B
PHP
Raw Normal View History

2021-01-19 17:45:33 +08:00
<?php
namespace Annotation\Model;
2021-02-22 17:44:24 +08:00
use Annotation\Annotation;
use Annotation\IAnnotation;
2021-01-19 17:45:33 +08:00
use Attribute;
2021-01-20 15:45:53 +08:00
use Database\ActiveRecord;
2021-02-22 17:44:24 +08:00
use Snowflake\Exception\ComponentException;
use Snowflake\Snowflake;
2021-01-19 17:45:33 +08:00
/**
* Class Get
* @package Annotation\Model
*/
2021-02-22 17:44:24 +08:00
#[Attribute(Attribute::TARGET_METHOD)] class Get implements IAnnotation
2021-01-19 17:45:33 +08:00
{
2021-01-20 15:46:26 +08:00
/**
* Get constructor.
* @param string $name
*/
2021-01-19 17:48:28 +08:00
public function __construct(
public string $name
)
2021-01-19 17:45:33 +08:00
{
}
2021-02-22 17:44:24 +08:00
/**
* @param array $handler
* @return Annotation
* @throws ComponentException
*/
public function execute(array $handler): Annotation
{
// TODO: Implement execute() method.
$annotation = Snowflake::app()->getAttributes();
$annotation->addMethodAttribute($handler, $this->name);
return $annotation;
}
2021-01-19 17:45:33 +08:00
}