当前位置: 首页>>代码示例>>PHP>>正文


PHP Varien_Simplexml_Element::asArray方法代码示例

本文整理汇总了PHP中Varien_Simplexml_Element::asArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Simplexml_Element::asArray方法的具体用法?PHP Varien_Simplexml_Element::asArray怎么用?PHP Varien_Simplexml_Element::asArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Varien_Simplexml_Element的用法示例。


在下文中一共展示了Varien_Simplexml_Element::asArray方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: import

 /**
  * @todo need create typical interface
  */
 public function import($filePath)
 {
     $content = file_get_contents($filePath);
     $xml = new Varien_Simplexml_Element($content);
     $template = $xml->asArray();
     $model = $this->getCollection()->addFieldToFilter('name', $template['name'])->getFirstItem();
     $model->addData($template)->save();
     return $model;
 }
开发者ID:santhosh400,项目名称:ecart,代码行数:12,代码来源:Rule.php

示例2: import

 public function import($path)
 {
     $content = file_get_contents($path);
     $xml = new Varien_Simplexml_Element($content);
     $design = $xml->asArray();
     if (isset($design['styles64'])) {
         $design['styles'] = base64_decode($design['styles64']);
     }
     if (isset($design['template64'])) {
         $design['template'] = base64_decode($design['template64']);
     }
     $model = $this->getCollection()->addFieldToFilter('title', $design['title'])->getFirstItem();
     $model->addData($design)->save();
     return $model;
 }
开发者ID:ashfaqphplhr,项目名称:artificiallawnsforturf,代码行数:15,代码来源:Design.php

示例3: getAvailableApps

 /**
  * Get list availabel apps
  * 
  * @return array
  */
 public function getAvailableApps()
 {
     $apps = array();
     try {
         $appXML = new Varien_Simplexml_Element($this->getProductFeed());
         $apps = $appXML->asArray();
         /* remove CDATA, group by category */
         if (count($apps)) {
             foreach ($apps as $key => $app) {
                 foreach ($app as $attribute => $value) {
                     $apps[$key][$attribute] = str_replace('<![CDATA[', '', str_replace(']]>', '', $value));
                 }
             }
         }
     } catch (Exception $e) {
         $this->getProductFeed(true);
     }
     return $apps;
 }
开发者ID:javik223,项目名称:Evron-Magento,代码行数:24,代码来源:Data.php

示例4: processXml

 /**
  * Convert attributes xml to array
  *
  * @param string $xmlString
  * @return array
  */
 public function processXml($xmlString = '')
 {
     if ($xmlString) {
         $xmlObj = new Varien_Simplexml_Element($xmlString);
         $attributes = $xmlObj->asArray();
         if (isset($attributes[self::XML_PROTOTYPE_NODE])) {
             return $attributes[self::XML_PROTOTYPE_NODE];
         }
     }
     return array();
 }
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:17,代码来源:Processor.php

示例5: getSagePayUrlsAsArray

 public function getSagePayUrlsAsArray()
 {
     //$cache = Mage::getSingleton('core/cache')->load('sagepayurls');
     $cache = Mage::app()->loadCache('sagepayurls');
     if (false === $cache) {
         $file = Mage::getModuleDir('etc', 'Ebizmarts_SagePaySuite') . DS . 'sagepayurls.xml';
         $element = new Varien_Simplexml_Element(file_get_contents($file));
         $data = $element->asArray();
         $data['sagepayserver_moto'] = $data['sagepayserver'];
         $data['sagepaydirectpro_moto'] = $data['sagepaydirectpro'];
         //Mage::getSingleton('core/cache')->save(serialize($data), 'sagepayurls');
         Mage::app()->saveCache(serialize($data), 'sagepayurls');
         return $data;
     }
     return unserialize($cache);
 }
开发者ID:xiaoguizhidao,项目名称:mydigibits,代码行数:16,代码来源:Data.php

示例6: import

 public function import($path)
 {
     $content = file_get_contents($path);
     $xml = new Varien_Simplexml_Element($content);
     $template = $xml->asArray();
     $template['areas_content'] = base64_decode($template['areas_content64']);
     $model = $this->getCollection()->addFieldToFilter('title', $template['title'])->getFirstItem();
     $model->addData($template);
     $design = Mage::getModel('emaildesign/design')->getCollection()->addFieldToFilter('title', $template['design_title'])->getFirstItem();
     $model->setDesignId($design->getId())->save();
     return $model;
 }
开发者ID:ashfaqphplhr,项目名称:artificiallawnsforturf,代码行数:12,代码来源:Template.php


注:本文中的Varien_Simplexml_Element::asArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。