Skip to content

Commit 03f9c32

Browse files
committed
改进hasData方法对字段映射支持
1 parent b18f987 commit 03f9c32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/model/concern/Attribute.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ public function getData(?string $name = null)
370370
*/
371371
public function hasData(string $name): bool
372372
{
373-
return $this->hasGetAttr($name) || array_key_exists($name, self::$weakMap[$this]['data']);
373+
return $this->hasGetAttr($name) || array_key_exists($this->getMappingName($name), self::$weakMap[$this]['data']);
374374
}
375375

376376
/**

0 commit comments

Comments
 (0)