From 31ad3d568c1e67aff73150aa67121254c30f4830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 19 Jan 2021 17:56:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Database/Base/BaseActiveRecord.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Database/Base/BaseActiveRecord.php b/Database/Base/BaseActiveRecord.php index a4f4a745..509ed6da 100644 --- a/Database/Base/BaseActiveRecord.php +++ b/Database/Base/BaseActiveRecord.php @@ -491,6 +491,11 @@ abstract class BaseActiveRecord extends Component implements IOrm, \ArrayAccess public function getAttribute(string $name) { $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]); }