private function parseObjectList()

in src/OSS/Result/ListObjectsV2Result.php [45:67]


    private function parseObjectList($xml, $encodingType)
    {
        $retList = array();
        if (isset($xml->Contents)) {
            foreach ($xml->Contents as $content) {
                $key = isset($content->Key) ? strval($content->Key) : "";
                $key = OssUtil::decodeKey($key, $encodingType);
                $lastModified = isset($content->LastModified) ? strval($content->LastModified) : "";
                $eTag = isset($content->ETag) ? strval($content->ETag) : "";
                $type = isset($content->Type) ? strval($content->Type) : "";
                $size = isset($content->Size) ? strval($content->Size) : "0";
                $storageClass = isset($content->StorageClass) ? strval($content->StorageClass) : "";
                if(isset($content->Owner)){
                    $owner = new Owner(strval($content->Owner->ID),strval($content->Owner->DisplayName));
                }else{
                    $owner = null;
                }
                $restoreInfo= isset($content->RestoreInfo) ? strval($content->RestoreInfo) : null;
                $retList[] = new ObjectInfo($key, $lastModified, $eTag, $type, $size, $storageClass,$owner,$restoreInfo);
            }
        }
        return $retList;
    }