object; if(!$cloud_service instanceof CloudService) return []; if(!count($relations)) $relations = $this->getAllowedRelations(); $values = parent::serialize($expand, $fields, $relations, $params); if(in_array('data_centers', $relations)){ $res = []; foreach ($cloud_service->getDataCenters() as $dataCenter){ $res[] = SerializerRegistry::getInstance() ->getSerializer($dataCenter) ->serialize($expand); } $values['data_centers'] = $res; } if(in_array('data_center_regions', $relations)){ $res = []; foreach ($cloud_service->getDataCenterRegions() as $region){ $res[] = SerializerRegistry::getInstance() ->getSerializer($region) ->serialize($expand); } $values['data_center_regions'] = $res; } if (!empty($expand)) { $exp_expand = explode(',', $expand); foreach ($exp_expand as $relation) { switch (trim($relation)) { } } } return $values; } }