Check if value is set before serializing

This commit is contained in:
2022-09-09 17:47:46 -04:00
parent 806b8e7b93
commit 51124218d5

View File

@ -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;