本文整理匯總了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;
}