Files
kiri-core/Annotation/Model/Set.php
T
as2252258@163.com 8137b24865 modify
2021-05-03 03:48:52 +08:00

39 lines
637 B
PHP

<?php
namespace Annotation\Model;
use Annotation\Attribute;
use Database\ActiveRecord;
use Snowflake\Snowflake;
#[\Attribute(\Attribute::TARGET_METHOD)] class Set extends Attribute
{
/**
* Set constructor.
* @param string $name
*/
public function __construct(public string $name)
{
}
/**
* @param mixed $class
* @param mixed|null $method
* @return bool
* @throws \Exception
*/
public function execute(mixed $class, mixed $method = null): bool
{
$annotation = Snowflake::getAnnotation();
$annotation->addSets($class::class, $this->name, $method);
return true;
}
}