diff --git a/Annotation/Annotation.php b/Annotation/Annotation.php index 74314bbd..c553c2c9 100644 --- a/Annotation/Annotation.php +++ b/Annotation/Annotation.php @@ -168,7 +168,7 @@ class Annotation extends Component } foreach ($this->_classes[$className] as $_method => $class) { if ($method == $_method) { - return [$class]; + return [$class, $_method]; } } return []; diff --git a/Database/Base/BaseActiveRecord.php b/Database/Base/BaseActiveRecord.php index 6d8b64f8..a4f4a745 100644 --- a/Database/Base/BaseActiveRecord.php +++ b/Database/Base/BaseActiveRecord.php @@ -386,7 +386,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, \ArrayAccess $lastId = $this->refresh(); } catch (\Throwable $exception) { $trance->rollback(); - $lastId = $this->addError($exception->getMessage(),'mysql'); + $lastId = $this->addError($exception->getMessage(), 'mysql'); } return $lastId; } @@ -665,6 +665,10 @@ abstract class BaseActiveRecord extends Component implements IOrm, \ArrayAccess */ public function __get($name): mixed { + $attributes = Snowflake::app()->getAttributes(); + $callback = $attributes->getByClass(static::class, $name); + var_dump($callback); + $method = 'get' . ucfirst($name); if (method_exists($this, $method . 'Attribute')) { return $this->{$method . 'Attribute'}($this->_attributes[$name] ?? null);