本文整理汇总了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;
}
示例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;
}
示例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;
}