Skip to content

Commit

Permalink
改进getData方法
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Oct 23, 2019
1 parent 09bc020 commit 02affaa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/model/concern/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ public function getData(string $name = null)

if (array_key_exists($fieldName, $this->data)) {
return $this->data[$fieldName];
} elseif (array_key_exists($name, $this->relation)) {
return $this->relation[$name];
} elseif (array_key_exists($fieldName, $this->relation)) {
return $this->relation[$fieldName];
}

throw new InvalidArgumentException('property not exists:' . static::class . '->' . $name);
Expand Down

0 comments on commit 02affaa

Please sign in to comment.