This commit is contained in:
2021-01-19 17:56:46 +08:00
parent fc3eba8a23
commit 31ad3d568c
+5
View File
@@ -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]);
}