Skip to content

Commit

Permalink
Amend d9b8f88: Fix model property value getter
Browse files Browse the repository at this point in the history
Delegate value retrieval to `AbstractEntity::offsetGet()`
  • Loading branch information
mcaskill committed Nov 24, 2017
1 parent 8f3561e commit ca80b40
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/Charcoal/Model/AbstractModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,16 +307,7 @@ public function flatData()
*/
public function propertyValue($propertyIdent)
{
$getter = $this->camelize($propertyIdent);
$method = [ $this, $getter ];

if (is_callable($method)) {
return call_user_func($method);
} elseif (isset($this->{$propertyIdent})) {
return $this->{$propertyIdent};
}

return null;
return $this[$propertyIdent];
}

/**
Expand Down

0 comments on commit ca80b40

Please sign in to comment.