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


PHP Registry::toArray方法代码示例

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


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

示例1: getItem

 public function getItem($pk = null)
 {
     $pk = !empty($pk) ? $pk : (int) JFactory::getApplication()->input->getint('id');
     $table = $this->getTable();
     if ($pk > 0) {
         // Attempt to load the row.
         $return = $table->load($pk);
         // Check for a table object error.
         if ($return === false && $table->getError()) {
             $this->setError($table->getError());
             return false;
         }
     }
     // Convert to the JObject before adding other data.
     $properties = $table->getProperties(1);
     $item = JArrayHelper::toObject($properties, 'JObject');
     if (property_exists($item, 'params')) {
         $registry = new Registry();
         $registry->loadString($item->params);
         $item->params = $registry->toArray();
     }
     return $item;
 }
开发者ID:Caojunkai,项目名称:working,代码行数:23,代码来源:welding.php

示例2: format

 /**
  * format - prune the registry based on xml config
  *
  * @param string    XMLpath
  * @param Registry  registry
  *
  * @return array
  */
 public static function format($xmlFilePath, $uri, Registry $registry)
 {
     $xml = file_get_contents($xmlFilePath);
     $xmlParser = new XMLParser();
     $params = $xmlParser->parse($xml, $uri, 'outputParam');
     unset($xmlParser);
     $output = array();
     if (count($params) < 1) {
         if (self::PARANOID_MODE) {
             error_log('XML is missing CherryPicker configs for ' . $uri);
             throw new XMLNodeNotConfiguredException('XML is missing CherryPicker configs for ' . $uri);
         }
         //not paranoid? ok - dump the whole registry to the user
         foreach ($registry->toArray() as $key => $value) {
             $output[self::trimNamespacing($key)] = $registry->{$key};
         }
         return $output;
     }
     foreach ($params as $key) {
         self::formatValue($key, $output, $registry);
     }
     return $output;
 }
开发者ID:dmeikle,项目名称:gossamerCMS-application,代码行数:31,代码来源:OutputCherryPicker.php

示例3: merge

 /**
  * Merge a Registry object into this one
  *
  * @param   Registry  $source     Source Registry object to merge. [@note Framework typehints this param]
  * @param   boolean   $recursive  True to support recursive merge the children values.
  *
  * @return  Registry  Return this object to support chaining.
  *
  * @since   1.0
  */
 public function merge($source, $recursive = false)
 {
     if (!$source instanceof Registry) {
         return false;
     }
     $data = $source->toArray();
     $array = array();
     foreach ($data as $k => $v) {
         if ($v !== null && $v !== '') {
             $array[$k] = $v;
         }
     }
     $this->bindData($this->data, $array, $recursive);
     return $this;
 }
开发者ID:01J,项目名称:skazkipronebo,代码行数:25,代码来源:Registry.php


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