改名
This commit is contained in:
@@ -116,6 +116,9 @@ class Annotation extends Component
|
|||||||
}
|
}
|
||||||
|
|
||||||
$tmp = $this->resolveAnnotations($method, $alias, $object);
|
$tmp = $this->resolveAnnotations($method, $alias, $object);
|
||||||
|
if (empty($tmp)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$this->_classes[$reflect->getName()][$method->getName()] = $tmp;
|
$this->_classes[$reflect->getName()][$method->getName()] = $tmp;
|
||||||
}
|
}
|
||||||
@@ -177,7 +180,7 @@ class Annotation extends Component
|
|||||||
}
|
}
|
||||||
foreach ($this->_classes[$className] as $_method => $class) {
|
foreach ($this->_classes[$className] as $_method => $class) {
|
||||||
if ($method == $_method) {
|
if ($method == $_method) {
|
||||||
return [$class, $_method];
|
return [$class];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
|
|||||||
@@ -310,14 +310,14 @@ class ActiveRecord extends BaseActiveRecord
|
|||||||
*/
|
*/
|
||||||
public function toArray(): array
|
public function toArray(): array
|
||||||
{
|
{
|
||||||
$data = [];
|
|
||||||
$attributes = Snowflake::app()->getAttributes();
|
$attributes = Snowflake::app()->getAttributes();
|
||||||
$callback = $attributes->getByClass(static::class);
|
$callback = $attributes->getByClass(static::class);
|
||||||
var_dump($callback);
|
|
||||||
|
|
||||||
foreach ($this->_attributes as $key => $val) {
|
$data = $this->_attributes;
|
||||||
$data[$key] = $this->getAttribute($key);
|
foreach ($callback as $key => $item) {
|
||||||
|
$data[$key] = call_user_func($item, $data[$key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return array_merge($data, $this->runRelate());
|
return array_merge($data, $this->runRelate());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user