Files
kiri-core/Annotation/Model/Get.php
T
2021-02-22 17:44:24 +08:00

50 lines
774 B
PHP

<?php
namespace Annotation\Model;
use Annotation\Annotation;
use Annotation\IAnnotation;
use Attribute;
use Database\ActiveRecord;
use Snowflake\Exception\ComponentException;
use Snowflake\Snowflake;
/**
* Class Get
* @package Annotation\Model
*/
#[Attribute(Attribute::TARGET_METHOD)] class Get implements IAnnotation
{
/**
* Get constructor.
* @param string $name
*/
public function __construct(
public string $name
)
{
}
/**
* @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;
}
}