/** * * @param SimpleXMLElement $elt * * @return FzSpeedLimits */ public static function fromXml(SimpleXMLElement $elt) { $fzSpeedLimit = new FzSpeedLimits(); $attributes['DlType'] = (string) $elt['DlType']; $attributes['DlLimit'] = (string) $elt['DlLimit']; $attributes['ServerDlLimitBypass'] = (string) $elt['ServerDlLimitBypass']; $attributes['UlType'] = (string) $elt['UlType']; $attributes['UlLimit'] = (string) $elt['UlLimit']; $attributes['ServerUlLimitBypass'] = (string) $elt['ServerUlLimitBypass']; $fzSpeedLimit->setAttributes($attributes); $download = array(); foreach ($elt->Download->Rule as $ruleElt) { $download[] = FzRule::fromXml($ruleElt); } $fzSpeedLimit->setDownload($download); $upload = array(); foreach ($elt->Upload->Rule as $ruleElt) { $upload[] = FzRule::fromXml($ruleElt); } $fzSpeedLimit->setUpload($upload); return $fzSpeedLimit; }