本文整理汇总了PHP中Shineisp_Commons_Utilities::simpleXMLToArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Shineisp_Commons_Utilities::simpleXMLToArray方法的具体用法?PHP Shineisp_Commons_Utilities::simpleXMLToArray怎么用?PHP Shineisp_Commons_Utilities::simpleXMLToArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shineisp_Commons_Utilities
的用法示例。
在下文中一共展示了Shineisp_Commons_Utilities::simpleXMLToArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSetup
/**
* Get the setup configuration
*
*
* @return ArrayObject
*/
public static function getSetup($id)
{
$setup = "";
$services = array();
$panel = Isp::getPanel();
$records = Doctrine_Query::create()->from('OrdersItems oi')->leftJoin('oi.Products p')->where('oi.detail_id = ?', $id)->execute(array(), Doctrine_Core::HYDRATE_ARRAY);
foreach ($records as $record) {
if (!empty($record['Products']['setup'])) {
$setup = $record['Products']['setup'];
// Get the parameters set in the order details (service)
$params = json_decode($record['parameters'], true);
if (is_array($params)) {
// Get the list of all the domains
$domains = OrdersItemsDomains::get_domains($record['detail_id']);
// We have to get the first domain
if (!empty($domains[0]['domain'])) {
$params['domain'] = $domains[0]['domain'];
// Get all the var {string} in the xml setup
preg_match_all('/{([^}]+)}/Ui', $setup, $matches);
foreach ($matches[1] as $parameter) {
$setup = str_replace("{" . $parameter . "}", $params[$parameter], $setup);
}
}
}
}
}
$xml = simplexml_load_string($setup);
$arrSetup = Shineisp_Commons_Utilities::simpleXMLToArray($xml);
return $arrSetup;
}