id = $subjectName; if(isset($data->displayName)) { $result->displayName = $data->displayName; } else { return null; } if(isset($data->description)) { $result->description = $data->description; } else { return null; } if(isset($data->color)) { $result->color = $data->color; } else { return null; } if(isset($data->buttonText)) { $result->buttonText = $data->buttonText; } else { return null; } if(isset($data->icon)) { $result->icon = $data->icon; } else { return null; } $result->topics = TopicData::getAll($subjectName); return $result; } }