當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Registry::toArray方法代碼示例

本文整理匯總了PHP中Joomla\Registry\Registry::toArray方法的典型用法代碼示例。如果您正苦於以下問題:PHP Registry::toArray方法的具體用法?PHP Registry::toArray怎麽用?PHP Registry::toArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Joomla\Registry\Registry的用法示例。


在下文中一共展示了Registry::toArray方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: execute

 protected function execute()
 {
     $this->state->set('plugins', $this->state->get('plugins', false));
     $app = new Sp4kAppsProductApp(new Joomla\Registry\Registry($this->state->toObject()));
     $items = new Registry($app->getItems());
     if ($this->state->get('nest', false)) {
         $this->items[] = (array) $this->create_tree($items->toArray());
     } else {
         $this->items = $items->toArray();
     }
 }
開發者ID:RustyIngles,項目名稱:sp4k_php,代碼行數:11,代碼來源:items.php

示例2: getItem

 /**
  * Method to get a single record.
  *
  * @param   integer  $pk  The id of the primary key.
  *
  * @return  mixed  Object on success, false on failure.
  *
  * @since   1.6
  */
 public function getItem($pk = null)
 {
     if ($item = parent::getItem($pk)) {
         if (!empty($item->params)) {
             // Convert the params field to an array.
             $registry = new Registry();
             $registry->loadString($item->params);
             $item->params = $registry->toArray();
         }
         if (!empty($item->metadata)) {
             // Convert the metadata field to an array.
             $registry = new Registry();
             $registry->loadString($item->metadata);
             $item->metadata = $registry->toArray();
         }
         if (!empty($item->interventions)) {
             // JSON Decode interventions.
             $item->interventions = json_decode($item->interventions);
         }
         if (!empty($item->id)) {
             $item->tags = new JHelperTags();
             $item->tags->getTagIds($item->id, 'com_costbenefitprojection.intervention');
         }
     }
     return $item;
 }
開發者ID:namibia,項目名稱:CBP-Joomla-3-Component,代碼行數:35,代碼來源:intervention.php

示例3: getItem

 /**
  * Method to get a single record.
  *
  * @param   integer  $pk  The id of the primary key.
  *
  * @return  mixed  Object on success, false on failure.
  *
  * @since   1.6
  */
 public function getItem($pk = null)
 {
     if ($item = parent::getItem($pk)) {
         if (!empty($item->params)) {
             // Convert the params field to an array.
             $registry = new Registry();
             $registry->loadString($item->params);
             $item->params = $registry->toArray();
         }
         if (!empty($item->metadata)) {
             // Convert the metadata field to an array.
             $registry = new Registry();
             $registry->loadString($item->metadata);
             $item->metadata = $registry->toArray();
         }
         if (!empty($item->template)) {
             // base64 Decode template.
             $item->template = base64_decode($item->template);
         }
         if (!empty($item->php_view)) {
             // base64 Decode php_view.
             $item->php_view = base64_decode($item->php_view);
         }
         if (!empty($item->id)) {
             $item->tags = new JHelperTags();
             $item->tags->getTagIds($item->id, 'com_componentbuilder.template');
         }
     }
     return $item;
 }
開發者ID:vdm-io,項目名稱:Joomla-Component-Builder,代碼行數:39,代碼來源:template.php

示例4: getItem

 /**
  * Method to get a single record.
  *
  * @param   integer  $pk  The id of the primary key.
  *
  * @return  mixed  Object on success, false on failure.
  *
  * @since   1.6
  */
 public function getItem($pk = null)
 {
     if ($item = parent::getItem($pk)) {
         if (!empty($item->params)) {
             // Convert the params field to an array.
             $registry = new Registry();
             $registry->loadString($item->params);
             $item->params = $registry->toArray();
         }
         if (!empty($item->metadata)) {
             // Convert the metadata field to an array.
             $registry = new Registry();
             $registry->loadString($item->metadata);
             $item->metadata = $registry->toArray();
         }
         if (!empty($item->groups)) {
             // JSON Decode groups.
             $item->groups = json_decode($item->groups, true);
         }
         if (!empty($item->id)) {
             $item->tags = new JHelperTags();
             $item->tags->getTagIds($item->id, 'com_componentbuilder.help_document');
         }
     }
     return $item;
 }
開發者ID:vdm-io,項目名稱:Joomla-Component-Builder,代碼行數:35,代碼來源:help_document.php

示例5: getItem

 /**
  * Method to get a single record.
  *
  * @param   integer  $pk  The id of the primary key.
  *
  * @return  mixed  Object on success, false on failure.
  *
  * @since   1.6
  */
 public function getItem($pk = null)
 {
     if ($item = parent::getItem($pk)) {
         if (!empty($item->params)) {
             // Convert the params field to an array.
             $registry = new Registry();
             $registry->loadString($item->params);
             $item->params = $registry->toArray();
         }
         if (!empty($item->metadata)) {
             // Convert the metadata field to an array.
             $registry = new Registry();
             $registry->loadString($item->metadata);
             $item->metadata = $registry->toArray();
         }
         if (!empty($item->testcompanies)) {
             // JSON Decode testcompanies.
             $item->testcompanies = json_decode($item->testcompanies);
         }
         if (!empty($item->id)) {
             $item->tags = new JHelperTags();
             $item->tags->getTagIds($item->id, 'com_costbenefitprojection.service_provider');
         }
     }
     $this->service_providervvvx = $item->id;
     return $item;
 }
開發者ID:namibia,項目名稱:CBP-Joomla-3-Component,代碼行數:36,代碼來源:service_provider.php

示例6: getItem

 /**
  * Method to get a single record.
  *
  * @param   integer  $pk  The id of the primary key.
  *
  * @return  mixed  Object on success, false on failure.
  *
  * @since   1.6
  */
 public function getItem($pk = null)
 {
     if ($item = parent::getItem($pk)) {
         if (!empty($item->params)) {
             // Convert the params field to an array.
             $registry = new Registry();
             $registry->loadString($item->params);
             $item->params = $registry->toArray();
         }
         if (!empty($item->metadata)) {
             // Convert the metadata field to an array.
             $registry = new Registry();
             $registry->loadString($item->metadata);
             $item->metadata = $registry->toArray();
         }
         if (!empty($item->causesrisks)) {
             // JSON Decode causesrisks.
             $item->causesrisks = json_decode($item->causesrisks);
         }
         if (!empty($item->id)) {
             $item->tags = new JHelperTags();
             $item->tags->getTagIds($item->id, 'com_costbenefitprojection.country');
         }
     }
     $this->countryvvvy = $item->id;
     $this->countryvvvz = $item->id;
     $this->countryvvwa = $item->id;
     return $item;
 }
開發者ID:namibia,項目名稱:CBP-Joomla-3-Component,代碼行數:38,代碼來源:country.php

示例7: prepareExecute

 /**
  * prepareExecute
  *
  * @return  void
  */
 protected function prepareExecute()
 {
     parent::prepareExecute();
     $this->app->setUserState("com_userxtd.edit.field.data", $this->input->getVar('jform'));
     $attrs = $this->app->getUserState("com_userxtd.edit.field.attrs", array());
     $postAttrs = $this->input->getVar('attrs', array());
     $attrs = new Registry($attrs);
     $attrs->loadArray($postAttrs);
     $this->app->setUserState("com_userxtd.edit.field.attrs", $attrs->toArray());
 }
開發者ID:ForAEdesWeb,項目名稱:AEW3,代碼行數:15,代碼來源:display.php

示例8: getItem

 /**
  * Method to get a single record.
  *
  * @param   integer  $pk  The id of the primary key.
  *
  * @return  mixed  Object on success, false on failure.
  *
  * @since   1.6
  */
 public function getItem($pk = null)
 {
     if ($item = parent::getItem($pk)) {
         if (!empty($item->params)) {
             // Convert the params field to an array.
             $registry = new Registry();
             $registry->loadString($item->params);
             $item->params = $registry->toArray();
         }
         if (!empty($item->metadata)) {
             // Convert the metadata field to an array.
             $registry = new Registry();
             $registry->loadString($item->metadata);
             $item->metadata = $registry->toArray();
         }
         if (!empty($item->php_after_getitem)) {
             // base64 Decode php_after_getitem.
             $item->php_after_getitem = base64_decode($item->php_after_getitem);
         }
         if (!empty($item->php_before_getitems)) {
             // base64 Decode php_before_getitems.
             $item->php_before_getitems = base64_decode($item->php_before_getitems);
         }
         if (!empty($item->php_before_getitem)) {
             // base64 Decode php_before_getitem.
             $item->php_before_getitem = base64_decode($item->php_before_getitem);
         }
         if (!empty($item->php_getlistquery)) {
             // base64 Decode php_getlistquery.
             $item->php_getlistquery = base64_decode($item->php_getlistquery);
         }
         if (!empty($item->php_after_getitems)) {
             // base64 Decode php_after_getitems.
             $item->php_after_getitems = base64_decode($item->php_after_getitems);
         }
         if (!empty($item->php_calculation)) {
             // base64 Decode php_calculation.
             $item->php_calculation = base64_decode($item->php_calculation);
         }
         if (!empty($item->php_custom_get)) {
             // base64 Decode php_custom_get.
             $item->php_custom_get = base64_decode($item->php_custom_get);
         }
         if (!empty($item->id)) {
             $item->tags = new JHelperTags();
             $item->tags->getTagIds($item->id, 'com_componentbuilder.dynamic_get');
         }
     }
     return $item;
 }
開發者ID:vdm-io,項目名稱:Joomla-Component-Builder,代碼行數:59,代碼來源:dynamic_get.php

示例9: getItem

 /**
  * Method to get a single record.
  *
  * @param   integer  $pk  The id of the primary key.
  *
  * @return  mixed  Object on success, false on failure.
  */
 public function getItem($pk = null)
 {
     if ($item = parent::getItem($pk)) {
         // Convert the images field to an array.
         $registry = new Registry();
         $registry->loadString($item->images);
         $item->images = $registry->toArray();
         //Convert the sensors field to an array
         $registry = new Registry();
         $registry->loadString($item->sensors);
         $item->sensors = $registry->toArray();
     }
     return $item;
 }
開發者ID:bobozhangshao,項目名稱:admin-com_heartcare,代碼行數:21,代碼來源:device.php

示例10: getItem

 /**
  * Method to get a single record.
  *
  * @param   integer  $pk  The id of the primary key.
  *
  * @return  mixed  Object on success, false on failure.
  *
  * @since   1.6
  */
 public function getItem($pk = null)
 {
     if ($item = parent::getItem($pk)) {
         if (!empty($item->params)) {
             // Convert the params field to an array.
             $registry = new Registry();
             $registry->loadString($item->params);
             $item->params = $registry->toArray();
         }
         if (!empty($item->metadata)) {
             // Convert the metadata field to an array.
             $registry = new Registry();
             $registry->loadString($item->metadata);
             $item->metadata = $registry->toArray();
         }
         if (!empty($item->xml)) {
             // JSON Decode xml.
             $item->xml = json_decode($item->xml);
         }
         if (!empty($item->css_view)) {
             // base64 Decode css_view.
             $item->css_view = base64_decode($item->css_view);
         }
         if (!empty($item->css_views)) {
             // base64 Decode css_views.
             $item->css_views = base64_decode($item->css_views);
         }
         if (!empty($item->javascript_view_footer)) {
             // base64 Decode javascript_view_footer.
             $item->javascript_view_footer = base64_decode($item->javascript_view_footer);
         }
         if (!empty($item->javascript_views_footer)) {
             // base64 Decode javascript_views_footer.
             $item->javascript_views_footer = base64_decode($item->javascript_views_footer);
         }
         if (!empty($item->id)) {
             $item->tags = new JHelperTags();
             $item->tags->getTagIds($item->id, 'com_componentbuilder.field');
         }
     }
     return $item;
 }
開發者ID:vdm-io,項目名稱:Joomla-Component-Builder,代碼行數:51,代碼來源:field.php

示例11: getItem

 /**
  * Method to get a single record.
  *
  * @param   integer  $pk  The id of the primary key.
  *
  * @return  mixed  Object on success, false on failure.
  *
  * @since   1.6
  */
 public function getItem($pk = null)
 {
     if ($item = parent::getItem($pk)) {
         if (!empty($item->params)) {
             // Convert the params field to an array.
             $registry = new Registry();
             $registry->loadString($item->params);
             $item->params = $registry->toArray();
         }
         if (!empty($item->metadata)) {
             // Convert the metadata field to an array.
             $registry = new Registry();
             $registry->loadString($item->metadata);
             $item->metadata = $registry->toArray();
         }
         if (!empty($item->id)) {
             $item->tags = new JHelperTags();
             $item->tags->getTagIds($item->id, 'com_demo.look');
         }
     }
     return $item;
 }
開發者ID:namibia,項目名稱:demo-joomla-3-component,代碼行數:31,代碼來源:look.php

示例12: getItem

 /**
  * Method to get a single record.
  *
  * @param   integer  $pk  The id of the primary key.
  *
  * @return  mixed  Object on success, false on failure.
  */
 public function getItem($pk = null)
 {
     if ($item = parent::getItem($pk)) {
         // Convert the params field to an array.
         $registry = new Registry();
         $registry->loadString($item->attribs);
         $item->attribs = $registry->toArray();
         // Convert the metadata field to an array.
         $registry = new Registry();
         $registry->loadString($item->metadata);
         $item->metadata = $registry->toArray();
         // Convert the images field to an array.
         $registry = new Registry();
         $registry->loadString($item->images);
         $item->images = $registry->toArray();
         // Convert the urls field to an array.
         $registry = new Registry();
         $registry->loadString($item->urls);
         $item->urls = $registry->toArray();
         $item->articletext = trim($item->fulltext) != '' ? $item->introtext . "<hr id=\"system-readmore\" />" . $item->fulltext : $item->introtext;
         if (!empty($item->id)) {
             $item->tags = new JHelperTags();
             $item->tags->getTagIds($item->id, 'com_content.article');
         }
     }
     // Load associated content items
     $app = JFactory::getApplication();
     $assoc = JLanguageAssociations::isEnabled();
     if ($assoc) {
         $item->associations = array();
         if ($item->id != null) {
             $associations = JLanguageAssociations::getAssociations('com_content', '#__content', 'com_content.item', $item->id);
             foreach ($associations as $tag => $association) {
                 $item->associations[$tag] = $association->id;
             }
         }
     }
     return $item;
 }
開發者ID:SysBind,項目名稱:joomla-cms,代碼行數:46,代碼來源:article.php

示例13: merge

 /**
  * Merge a Registry object into this one
  *
  * @param   Registry  $source     Source Registry object to merge.
  * @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;
     }
     $this->bindData($this->data, $source->toArray(), $recursive, false);
     return $this;
 }
開發者ID:nkuitche,項目名稱:registry,代碼行數:18,代碼來源:Registry.php

示例14: getData

 /**
  * Method to get the profile form data.
  *
  * The base form data is loaded and then an event is fired
  * for users plugins to extend the data.
  *
  * @return  mixed  	Data object on success, false on failure.
  *
  * @since   1.6
  */
 public function getData()
 {
     if ($this->data === null) {
         $userId = $this->getState('user.id');
         // Initialise the table with JUser.
         $this->data = new JUser($userId);
         // Set the base user data.
         $this->data->email1 = $this->data->get('email');
         $this->data->email2 = $this->data->get('email');
         // Override the base user data with any data in the session.
         $temp = (array) JFactory::getApplication()->getUserState('com_users.edit.profile.data', array());
         foreach ($temp as $k => $v) {
             $this->data->{$k} = $v;
         }
         // Unset the passwords.
         unset($this->data->password1);
         unset($this->data->password2);
         $registry = new Registry($this->data->params);
         $this->data->params = $registry->toArray();
         // Get the dispatcher and load the users plugins.
         $dispatcher = JEventDispatcher::getInstance();
         JPluginHelper::importPlugin('user');
         // Trigger the data preparation event.
         $results = $dispatcher->trigger('onContentPrepareData', array('com_users.profile', $this->data));
         // Check for errors encountered while preparing the data.
         if (count($results) && in_array(false, $results, true)) {
             $this->setError($dispatcher->getError());
             $this->data = false;
         }
     }
     return $this->data;
 }
開發者ID:joomla-projects,項目名稱:media-manager-improvement,代碼行數:42,代碼來源:profile.php

示例15: getItems

 /**
  * Method to get a list of teamids.
  *
  * Overriden to inject convert the params fields into an object.
  *
  * @return	mixed	An array of objects on success, false on failure.
  * 
  */
 public function getItems()
 {
     $db = $this->getDbo();
     $query = $db->getQuery(true);
     $user = JFactory::getUser();
     $user_id = $user->get('id');
     $guest = $user->get('guest');
     $groups = $user->getAuthorisedViewLevels();
     // Get the global params
     $global_params = JComponentHelper::getParams('com_knvbapi2', true);
     if ($items = parent::getItems()) {
         // Convert the parameter fields into objects.
         foreach ($items as &$item) {
             $query->clear();
             $teamid_params = new Registry();
             $teamid_params->loadString($item->params);
             // Convert the images field to an array.
             $registry = new Registry();
             $registry->loadString($item->images);
             $item->images = $registry->toArray();
             $registry = null;
             //release memory
             // Convert the urls field to an array.
             $registry = new Registry();
             $registry->loadString($item->urls);
             $item->urls = $registry->toArray();
             $registry = null;
             //release memory
             $item->introdescription = trim($item->intro) != '' ? $item->intro . $item->description : $item->description;
             // Unpack readmore and layout params
             $item->teamid_alternative_readmore = $teamid_params->get('teamid_alternative_readmore');
             $item->layout = $teamid_params->get('layout');
             if (!is_object($this->getState('params'))) {
                 $item->params = $teamid_params;
             } else {
                 $item->params = clone $this->getState('params');
                 // Teamid params override menu item params only if menu param = 'use_teamid'
                 // Otherwise, menu item params control the layout
                 // If menu item is 'use_teamid' and there is no teamid param, use global
                 // create an array of just the params set to 'use_teamid'
                 $menu_params_array = $this->getState('params')->toArray();
                 $teamid_array = array();
                 foreach ($menu_params_array as $key => $value) {
                     if ($value === 'use_teamid') {
                         // if the teamid has a value, use it
                         if ($teamid_params->get($key) != '') {
                             // get the value from the teamid
                             $teamid_array[$key] = $teamid_params->get($key);
                         } else {
                             // otherwise, use the global value
                             $teamid_array[$key] = $global_params->get($key);
                         }
                     }
                 }
                 // merge the selected teamid params
                 if (count($teamid_array) > 0) {
                     $teamid_params = new Registry();
                     $teamid_params->loadArray($teamid_array);
                     $item->params->merge($teamid_params);
                 }
                 // get display date
                 switch ($item->params->get('list_show_teamid_date')) {
                     case 'modified':
                         $item->display_date = $item->modified;
                         break;
                     case 'publish_up':
                         $item->display_date = $item->publish_up;
                         if ($item->publish_up == 0) {
                             $item->display_date = $item->created;
                         }
                         break;
                     case 'created':
                         $item->display_date = $item->created;
                         break;
                     default:
                         $item->display_date = 0;
                         break;
                 }
             }
             // Compute the asset access permissions.
             // Technically guest could edit an teamid, but lets not check that to improve performance a little.
             if (!$guest) {
                 $asset = 'com_knvbapi2.teamid.' . $item->id;
                 // Check general edit permission first.
                 if ($user->authorise('core.edit', $asset)) {
                     $item->params->set('access-edit', true);
                 } else {
                     if (!empty($user_id) and $user->authorise('core.edit.own', $asset)) {
                         // Check for a valid user and that they are the owner.
                         if ($user_id == $item->created_by) {
                             $item->params->set('access-edit', true);
                         }
//.........這裏部分代碼省略.........
開發者ID:esorone,項目名稱:efcpw,代碼行數:101,代碼來源:teamids.php


注:本文中的Joomla\Registry\Registry::toArray方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。