Check if value is set before serializing
This commit is contained in:
@ -79,6 +79,9 @@ abstract class Model implements ModelInterface
|
||||
continue;
|
||||
}
|
||||
$p = strtolower(str_replace('get', '', $method->getName()));
|
||||
if (!isset($this->{$p})) {
|
||||
continue;
|
||||
}
|
||||
$output[$p] = $this->{$method->getName()}();
|
||||
}
|
||||
return $output;
|
||||
|
Reference in New Issue
Block a user