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