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


PHP FieldGroup::toArray方法代码示例

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


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

示例1: testToArray2

 public function testToArray2()
 {
     $FGC = new DOMDocument('1.0', 'UTF-8');
     $FGC->load(FGC, LIBXML_NOBLANKS);
     $FGCXPath = new DOMXPath($FGC);
     $FGCXPath->registerNamespace('fg', 'http://keg.vse.cz/ns/fieldgroupconfig0_1');
     $FGCNode = $FGCXPath->evaluate('//FieldGroupConfig[2]')->item(0);
     $FG = new FieldGroup($FGCNode, $FGCXPath, 'en', false, $this->attributes, $this->coefficients);
     $FG->parse();
     $array = array(0 => array('id' => 2, 'name' => 'Personal characteristics', 'localizedName' => 'Personal characteristics', 'explanation' => 'Personal characteristics of a client.', 'fieldConfig' => array('Salary' => array('coefficient' => array('type' => 'Subset', 'minimalLength' => 1, 'maximalLength' => 1)), 'Sex' => array('coefficient' => array('type' => 'One category', 'category' => 'M')), 'Age' => array('coefficient' => array('type' => 'Subset', 'minimalLength' => 1, 'maximalLength' => 1))), 'childGroups' => array(), 'connective' => 'Conjunction'));
     $data = $FG->toArray();
     $this->assertEquals($array, $data);
 }
开发者ID:KIZI,项目名称:sewebar-cms,代码行数:13,代码来源:FieldGroupTest.php

示例2: parseFieldGroupConfig

 protected function parseFieldGroupConfig($id, $config)
 {
     $FGCNode = $this->XPath->evaluate('//FieldGroupConfig[@id="' . $id . '"]')->item(0);
     if ($FGCNode === null) {
         throw new InvalidFieldGroupConfigException('Invalid field group config structure.');
     }
     $FG = new FieldGroup($FGCNode, $this->XPath, $this->lang, $this->rootConfigID === $id, $this->attributes, $this->coefficients);
     $FG->parse();
     $config = array_merge_recursive($config, $FG->toArray());
     if ($FG->hasChildGroups() === true) {
         foreach ($FG->getChildGroups() as $chg) {
             $config = $this->parseFieldGroupConfig($chg, $config);
         }
     }
     return $config;
 }
开发者ID:KIZI,项目名称:sewebar-cms,代码行数:16,代码来源:FieldGroupConfigParser.php


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