This commit is contained in:
as2252258@163.com
2021-08-29 04:06:48 +08:00
parent 360c00c6eb
commit 0e7b59eb9c
3 changed files with 34 additions and 29 deletions
+18 -17
View File
@@ -20,25 +20,26 @@ use Kiri\Kiri;
{
/**
* Relation constructor.
* @param string $name
*/
public function __construct(public string $name)
{
}
/**
* Relation constructor.
* @param string $name
*/
public function __construct(string $name)
{
}
/**
* @param mixed $class
* @param mixed|null $method
* @return bool
* @throws Exception
*/
public function execute(mixed $class, mixed $method = null): bool
{
di(Relate::class)->addRelate($class, $this->name, $method);
/**
* @param static $params
* @param mixed $class
* @param mixed|null $method
* @return bool
* @throws Exception
*/
public static function execute(mixed $params, mixed $class, mixed $method = null): bool
{
di(Relate::class)->addRelate($class, $params->name, $method);
return true;
}
}
}