Files
kiri-core/Annotation/Model/Relation.php
T
2021-03-04 14:24:45 +08:00

44 lines
668 B
PHP

<?php
namespace Annotation\Model;
use Annotation\Attribute;
use Database\ActiveRecord;
use JetBrains\PhpStorm\Pure;
/**
* Class Relation
* @package Annotation\Model
*/
#[\Attribute(\Attribute::TARGET_METHOD)] class Relation extends Attribute
{
/**
* Relation constructor.
* @param string $name
*/
public function __construct(public string $name)
{
}
/**
* @param array $handler
* @return mixed
*/
#[Pure] public function execute(array $handler): mixed
{
// /** @var ActiveRecord $activeRecord */
// [$activeRecord, $method] = $handler;
//
// $activeRecord->setRelate($this->name, $method);
return parent::execute($handler);
}
}