Skip to content

Commit

Permalink
原始数据中如果是convertObject,导致调用失败
Browse files Browse the repository at this point in the history
  • Loading branch information
kiss291323003 committed Mar 19, 2024
1 parent c97b436 commit c0d2cb8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/AbstractInterface/AbstractEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ function setData(array $data,bool $mergeCompare = false)
/** @var Property $property */
$property = $allProperties[$key];
if($property->convertObject && ($val !== null)){
$object = call_user_func([$property->convertObject,'toObject'],$val);
if($val instanceof $property->convertObject){
$object = $val;
}else{
$object = call_user_func([$property->convertObject,'toObject'],$val);
}
$this->{$key} = $object;
if($mergeCompare){
$this->compareData[$key] = $this->{$key}->toValue();
Expand Down

0 comments on commit c0d2cb8

Please sign in to comment.