[BUGFIX] API Utility: Check if method is object before checking for class
This commit is contained in:
parent
a4faec9eb3
commit
f52f1c2c35
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user