[BUGFIX] API Utility: Check if method is object before checking for class

This commit is contained in:
Philipp Dieter 2025-05-26 18:13:23 +02:00
parent a4faec9eb3
commit f52f1c2c35

View File

@ -77,7 +77,9 @@ class ApiUtility
if (substr($method, 0, 3) === 'get') { if (substr($method, 0, 3) === 'get') {
$methodResult = call_user_func([$row, $method]); $methodResult = call_user_func([$row, $method]);
$attributeName = lcfirst(substr($method, 3)); $attributeName = lcfirst(substr($method, 3));
if (get_class($methodResult) == LazyLoadingProxy::class) { if (is_object($methodResult)
&& get_class($methodResult) == LazyLoadingProxy::class
) {
$methodResult = $methodResult->_loadRealInstance(); $methodResult = $methodResult->_loadRealInstance();
} }
$propertieResults[$attributeName] = $methodResult; $propertieResults[$attributeName] = $methodResult;