當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Xml::xstring方法代碼示例

本文整理匯總了PHP中Xml::xstring方法的典型用法代碼示例。如果您正苦於以下問題:PHP Xml::xstring方法的具體用法?PHP Xml::xstring怎麽用?PHP Xml::xstring使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Xml的用法示例。


在下文中一共展示了Xml::xstring方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: createFromXml

 public static function createFromXml($xml)
 {
     $r = new Range();
     $r->low = Xml::xstring($xml, 'low');
     $r->high = Xml::xstring($xml, 'high');
     return $r;
 }
開發者ID:verticaltab,項目名稱:pillow,代碼行數:7,代碼來源:Range.php

示例2: createFromXml

 public static function createFromXml($xml)
 {
     $z = new Zestimate();
     $z->amount = Xml::xstring($xml, 'amount');
     $z->lastUpdated = new Date(Xml::xstring($xml, 'last-updated'));
     $z->thirtyDayChange = Xml::xstring($xml, 'valueChange[@duration="30"]');
     $z->percentile = Xml::xstring($xml, 'percentile');
     $ranges = $xml->xpath('valuationRange');
     if (count($ranges == 1)) {
         $z->range = Range::createFromXml($ranges[0]);
     }
     return $z;
 }
開發者ID:verticaltab,項目名稱:pillow,代碼行數:13,代碼來源:Zestimate.php

示例3: createFromXmlDeep

 public static function createFromXmlDeep($xml, $service)
 {
     $prop = new Property();
     $prop->zpid = Xml::xstring($xml, 'zpid');
     $prop->street = Xml::xstring($xml, 'address/street');
     $prop->zipcode = Xml::xstring($xml, 'address/zipcode');
     $prop->city = Xml::xstring($xml, 'address/city');
     $prop->state = Xml::xstring($xml, 'address/state');
     $prop->latitude = Xml::xstring($xml, 'address/latitude');
     $prop->longitude = Xml::xstring($xml, 'address/longitude');
     $prop->fipsCounty = Xml::xstring($xml, 'FIPScounty');
     $prop->useCode = Xml::xstring($xml, 'useCode');
     $prop->yearBuilt = Xml::xstring($xml, 'yearBuilt');
     $prop->lotSizeSqFt = Xml::xstring($xml, 'lotSizeSqFt');
     $prop->finishedSqFt = Xml::xstring($xml, 'finishedSqFt');
     $prop->bathrooms = Xml::xstring($xml, 'bathrooms');
     $prop->bedrooms = Xml::xstring($xml, 'bedrooms');
     $prop->lastSoldDate = Xml::xstring($xml, 'lastSoldDate');
     $prop->lastSoldPrice = Xml::xstring($xml, 'lastSoldPrice');
     $links = $xml->xpath('links');
     if (count($links) == 1) {
         $prop->links = Links::createFromXml($links[0]);
     }
     $zestimates = $xml->xpath('zestimate');
     if (count($zestimates) == 1) {
         $prop->zestimate = Zestimate::createFromXml($zestimates[0]);
     }
     $prop->chart = new Proxy($service, 'getChart', array($prop->zpid, Chart::getDefaultWidth(), Chart::getDefaultHeight(), Chart::getDefaultUnitType(), Chart::getDefaultDuration()));
     $prop->comps = new Proxy($service, 'getComps', array($prop->zpid, Comps::getDefaultCompCount()));
     return $prop;
 }
開發者ID:verticaltab,項目名稱:pillow,代碼行數:31,代碼來源:Property.php


注:本文中的Xml::xstring方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。