modify plugin name

This commit is contained in:
2022-06-22 18:28:46 +08:00
parent c72c5d4e0d
commit 20eff5c29a
6 changed files with 3 additions and 24 deletions
+2 -4
View File
@@ -5,15 +5,14 @@ namespace Database\Annotation;
use Attribute; use Attribute;
use Database\Base\Getter; use Kiri\Annotation\AbstractAttribute;
use Exception;
/** /**
* Class Get * Class Get
* @package Annotation\Model * @package Annotation\Model
*/ */
#[Attribute(Attribute::TARGET_METHOD)] class Get extends \Kiri\Annotation\AbstractAttribute #[Attribute(Attribute::TARGET_METHOD)] class Get extends AbstractAttribute
{ {
@@ -33,7 +32,6 @@ use Exception;
*/ */
public function execute(mixed $class, mixed $method = null): bool public function execute(mixed $class, mixed $method = null): bool
{ {
di(Getter::class)->addGetter($this->name, $class, $method);
return true; return true;
} }
-2
View File
@@ -5,7 +5,6 @@ namespace Database\Annotation;
use Kiri\Annotation\AbstractAttribute; use Kiri\Annotation\AbstractAttribute;
use Database\Base\Relate;
use Exception; use Exception;
@@ -34,7 +33,6 @@ use Exception;
*/ */
public function execute(mixed $class, mixed $method = null): bool public function execute(mixed $class, mixed $method = null): bool
{ {
di(Relate::class)->addRelate($this->name, $class, $method);
return true; return true;
} }
-2
View File
@@ -5,7 +5,6 @@ namespace Database\Annotation;
use Kiri\Annotation\AbstractAttribute; use Kiri\Annotation\AbstractAttribute;
use Database\Base\Setter;
use Exception; use Exception;
#[\Attribute(\Attribute::TARGET_METHOD)] class Set extends AbstractAttribute #[\Attribute(\Attribute::TARGET_METHOD)] class Set extends AbstractAttribute
@@ -28,7 +27,6 @@ use Exception;
*/ */
public function execute(mixed $class, mixed $method = null): bool public function execute(mixed $class, mixed $method = null): bool
{ {
di(Setter::class)->addSetter($this->name, $class, $method);
return true; return true;
} }
+1 -1
View File
@@ -13,7 +13,7 @@ class Getter
* @param $class * @param $class
* @param $method * @param $method
*/ */
public function addGetter($name, $class, $method) public function addGetter($name, $class, $method): void
{ {
$this->_classMapping[$class][$name] = $method; $this->_classMapping[$class][$name] = $method;
} }
-11
View File
@@ -734,17 +734,6 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T
} }
/**
* @param $name
* @return array|string|null
* @throws Exception
*/
public function getRelate($name): null|array|string
{
return di(Relate::class)->getRelate(static::class, $name);
}
/** /**
* @param $attribute * @param $attribute
* @return bool * @return bool
-4
View File
@@ -10,15 +10,11 @@ declare(strict_types=1);
namespace Database; namespace Database;
use Database\Base\Getter;
use Database\Traits\HasBase;
use Exception; use Exception;
use Kiri; use Kiri;
use Kiri\Exception\NotFindClassException; use Kiri\Exception\NotFindClassException;
use Kiri\ToArray;
use Kiri\Error\StdoutLoggerInterface; use Kiri\Error\StdoutLoggerInterface;
use ReflectionException; use ReflectionException;
use Swoole\Coroutine;
defined('SAVE_FAIL') or define('SAVE_FAIL', 3227); defined('SAVE_FAIL') or define('SAVE_FAIL', 3227);
defined('FIND_OR_CREATE_MESSAGE') or define('FIND_OR_CREATE_MESSAGE', 'Create a new model, but the data cannot be empty.'); defined('FIND_OR_CREATE_MESSAGE') or define('FIND_OR_CREATE_MESSAGE', 'Create a new model, but the data cannot be empty.');