diff --git a/Database/ActiveRecord.php b/Database/ActiveRecord.php index d571afd9..318040f8 100644 --- a/Database/ActiveRecord.php +++ b/Database/ActiveRecord.php @@ -311,6 +311,10 @@ class ActiveRecord extends BaseActiveRecord public function toArray(): array { $data = []; + $attributes = Snowflake::app()->getAttributes(); + $callback = $attributes->getByClass(static::class); + var_dump($callback); + foreach ($this->_attributes as $key => $val) { $data[$key] = $this->getAttribute($key); } diff --git a/Database/Base/BaseActiveRecord.php b/Database/Base/BaseActiveRecord.php index 509ed6da..d642826c 100644 --- a/Database/Base/BaseActiveRecord.php +++ b/Database/Base/BaseActiveRecord.php @@ -492,10 +492,6 @@ abstract class BaseActiveRecord extends Component implements IOrm, \ArrayAccess { $method = 'get' . ucfirst($name) . 'Attribute'; - $attributes = Snowflake::app()->getAttributes(); - $callback = $attributes->getByClass(static::class, $name); - var_dump($callback); - if (method_exists($this, $method)) { return $this->$method($this->_attributes[$name]); }