Description
The PHP client library generated from the current schema produces incorrect unmarshalling code for KalturaLiveStatsListResponse, causing all object properties to be NULL despite the API returning the correct data.
Cause
The schema definition for KalturaLiveStatsListResponse specifies objects as a single KalturaLiveStats object instead of an array. However, the API response returns an array of KalturaLiveStats objects. The client-generator produced code that attempts to unmarshal the array wrapper as a single object, rather than iterating through array items.
Generated code (incorrect)
// LiveStatsListResponse.php
if(count($xml->objects) && !empty($xml->objects))
$this->objects = \Kaltura\Client\ParseUtils::unmarshalObject($xml->objects, "KalturaLiveStats");
Fix
The generated code should use unmarshalArray instead of unmarshalObject which solves the issue
// LiveStatsListResponse.php
if(count($xml->objects) && !empty($xml->objects))
$this->objects = \Kaltura\Client\ParseUtils::unmarshalArray($xml->objects, "KalturaLiveStats");
Description
The PHP client library generated from the current schema produces incorrect unmarshalling code for
KalturaLiveStatsListResponse, causing all object properties to be NULL despite the API returning the correct data.Cause
The schema definition for
KalturaLiveStatsListResponsespecifiesobjectsas a singleKalturaLiveStatsobject instead of an array. However, the API response returns an array ofKalturaLiveStatsobjects. The client-generator produced code that attempts to unmarshal the array wrapper as a single object, rather than iterating through array items.Generated code (incorrect)
Fix
The generated code should use
unmarshalArrayinstead ofunmarshalObjectwhich solves the issue