Expanded examples plus small bug fix

This commit is contained in:
Gregory Oschwald
2014-06-17 10:16:14 -07:00
parent 22babda1c9
commit cdf75ec505
3 changed files with 62 additions and 4 deletions
+2 -2
View File
@@ -24,7 +24,7 @@ abstract class AbstractModel implements \JsonSerializable
*/
protected function get($field)
{
return isset($this->raw[$field]) ? $this->raw[$field] : array();
return isset($this->raw[$field]) ? $this->raw[$field] : null;
}
/**
@@ -32,7 +32,7 @@ abstract class AbstractModel implements \JsonSerializable
*/
public function __get($attr)
{
if ($attr != "instance" && isset($this->$attr)) {
if ($attr != "instance" && property_exists($this, $attr)) {
return $this->$attr;
}