Skip to content

Commit 0bee7c0

Browse files
committed
getValue方法改为public 用于获取实际值
1 parent bf71eb6 commit 0bee7c0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Entity.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ protected function initializeData(array | object $data, bool $fromSave = false)
279279
$this->model()->setKey($val);
280280
}
281281

282-
if ($this->isView() || in_array($trueName, $fields)) {
282+
if ($this->isView() || $this->isVirtual() || in_array($trueName, $fields)) {
283283
// 读取数据后进行类型转换
284284
$value = $this->readTransform($val, $schema[$trueName] ?? 'string');
285285
// 数据赋值
@@ -1266,13 +1266,13 @@ public function get(string $name, bool $attr = true)
12661266
}
12671267

12681268
/**
1269-
* 获取数据对象的值
1269+
* 获取数据对象的实际值
12701270
*
12711271
* @param string $name 名称
12721272
*
12731273
* @return mixed
12741274
*/
1275-
private function getValue(string $name)
1275+
public function getValue(string $name)
12761276
{
12771277
if (!array_key_exists($name, self::$weakMap[$this]['data'])) {
12781278
// 动态获取关联数据

0 commit comments

Comments
 (0)