改名
This commit is contained in:
@@ -313,6 +313,9 @@ class ActiveRecord extends BaseActiveRecord
|
|||||||
{
|
{
|
||||||
$data = $this->_attributes;
|
$data = $this->_attributes;
|
||||||
foreach ($this->getAnnotation() as $key => $item) {
|
foreach ($this->getAnnotation() as $key => $item) {
|
||||||
|
if (!isset($data[$key])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$data[$key] = call_user_func($item, $data[$key]);
|
$data[$key] = call_user_func($item, $data[$key]);
|
||||||
}
|
}
|
||||||
return array_merge($data, $this->runRelate());
|
return array_merge($data, $this->runRelate());
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ namespace Database\Base;
|
|||||||
|
|
||||||
|
|
||||||
use Annotation\Model\Get;
|
use Annotation\Model\Get;
|
||||||
|
use ArrayAccess;
|
||||||
use HttpServer\Http\Context;
|
use HttpServer\Http\Context;
|
||||||
use ReflectionException;
|
use ReflectionException;
|
||||||
use Snowflake\Abstracts\Component;
|
use Snowflake\Abstracts\Component;
|
||||||
use Snowflake\Core\Json;
|
|
||||||
use Database\ActiveQuery;
|
use Database\ActiveQuery;
|
||||||
use Database\ActiveRecord;
|
use Database\ActiveRecord;
|
||||||
use Database\Connection;
|
use Database\Connection;
|
||||||
@@ -22,7 +22,6 @@ use Database\HasMany;
|
|||||||
use Database\HasOne;
|
use Database\HasOne;
|
||||||
use Database\Mysql\Columns;
|
use Database\Mysql\Columns;
|
||||||
use Database\Relation;
|
use Database\Relation;
|
||||||
use Snowflake\Error\Logger;
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use Snowflake\Exception\ComponentException;
|
use Snowflake\Exception\ComponentException;
|
||||||
use Snowflake\Exception\NotFindClassException;
|
use Snowflake\Exception\NotFindClassException;
|
||||||
@@ -39,7 +38,7 @@ use Snowflake\Snowflake;
|
|||||||
* @method rules()
|
* @method rules()
|
||||||
* @method static tableName()
|
* @method static tableName()
|
||||||
*/
|
*/
|
||||||
abstract class BaseActiveRecord extends Component implements IOrm, \ArrayAccess
|
abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
|
||||||
{
|
{
|
||||||
|
|
||||||
/** @var array */
|
/** @var array */
|
||||||
|
|||||||
Reference in New Issue
Block a user