改名
This commit is contained in:
@@ -184,7 +184,7 @@ class Annotation extends Component
|
|||||||
* @param string $property
|
* @param string $property
|
||||||
* @return mixed|null
|
* @return mixed|null
|
||||||
*/
|
*/
|
||||||
public function getPropertyAnnotation($class, $property = ''): ?array
|
public function getProperty($class, $property = ''): ?array
|
||||||
{
|
{
|
||||||
if (is_object($class)) {
|
if (is_object($class)) {
|
||||||
$class = get_class($class);
|
$class = get_class($class);
|
||||||
|
|||||||
@@ -119,9 +119,14 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
|
|||||||
{
|
{
|
||||||
$annotation = Snowflake::app()->getAttributes();
|
$annotation = Snowflake::app()->getAttributes();
|
||||||
|
|
||||||
$this->_annotations = $annotation->getMethods(get_called_class());
|
$name = static::class;
|
||||||
|
|
||||||
$lists = $annotation->getPropertyAnnotation(get_called_class());
|
$this->_annotations = $annotation->getMethods($name);
|
||||||
|
|
||||||
|
$lists = $annotation->getProperty($name);
|
||||||
|
if (empty($lists)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
foreach ($lists as $name => $list) {
|
foreach ($lists as $name => $list) {
|
||||||
$this->{$name} = $list;
|
$this->{$name} = $list;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user