改名
This commit is contained in:
@@ -13,7 +13,6 @@ namespace Database;
|
|||||||
use Database\Base\BaseActiveRecord;
|
use Database\Base\BaseActiveRecord;
|
||||||
use Database\Traits\HasBase;
|
use Database\Traits\HasBase;
|
||||||
use Exception;
|
use Exception;
|
||||||
use JetBrains\PhpStorm\Pure;
|
|
||||||
use ReflectionException;
|
use ReflectionException;
|
||||||
use Snowflake\Channel;
|
use Snowflake\Channel;
|
||||||
use Snowflake\Exception\NotFindClassException;
|
use Snowflake\Exception\NotFindClassException;
|
||||||
@@ -305,7 +304,7 @@ class ActiveRecord extends BaseActiveRecord
|
|||||||
{
|
{
|
||||||
$data = $this->_attributes;
|
$data = $this->_attributes;
|
||||||
|
|
||||||
$lists = $this->getAnnotation(self::GET);
|
$lists = Snowflake::getAnnotation()->getGets(static::class);
|
||||||
foreach ($lists as $key => $item) {
|
foreach ($lists as $key => $item) {
|
||||||
$data[$key] = $this->{$item}($data[$key] ?? null);
|
$data[$key] = $this->{$item}($data[$key] ?? null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -844,18 +844,13 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
|
|||||||
{
|
{
|
||||||
$value = $this->_attributes[$name] ?? null;
|
$value = $this->_attributes[$name] ?? null;
|
||||||
$method = $this->_get_annotation($name, static::GET);
|
$method = $this->_get_annotation($name, static::GET);
|
||||||
|
|
||||||
|
|
||||||
var_dump($method);
|
|
||||||
if (!empty($method)) {
|
if (!empty($method)) {
|
||||||
return $this->{$method}($value);
|
return $this->{$method}($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
$relation = $this->_get_annotation($name, static::RELATE);
|
$relation = $this->_get_annotation($name, static::RELATE);
|
||||||
if (empty($relation)) {
|
if (empty($relation)) {
|
||||||
return $this->_decode($name, $value);
|
return $this->_decode($name, $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($value = $this->{$relation}(...[$value])) instanceof HasBase) {
|
if (($value = $this->{$relation}(...[$value])) instanceof HasBase) {
|
||||||
return $value->get();
|
return $value->get();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user