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


PHP CostbenefitprojectionHelper::getGroupName方法代碼示例

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


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

示例1: getItems

 /**
  * Method to get an array of data items.
  *
  * @return  mixed  An array of data items on success, false on failure.
  */
 public function getItems()
 {
     // check in items
     $this->checkInNow();
     // load parent items
     $items = parent::getItems();
     // set values to display correctly.
     if (CostbenefitprojectionHelper::checkArray($items)) {
         // get user object.
         $user = JFactory::getUser();
         foreach ($items as $nr => &$item) {
             $access = $user->authorise('help_document.access', 'com_costbenefitprojection.help_document.' . (int) $item->id) && $user->authorise('help_document.access', 'com_costbenefitprojection');
             if (!$access) {
                 unset($items[$nr]);
                 continue;
             }
             // decode groups
             $groupsArray = json_decode($item->groups, true);
             if (CostbenefitprojectionHelper::checkArray($groupsArray)) {
                 $groupsNames = '';
                 $counter = 0;
                 foreach ($groupsArray as $groups) {
                     if ($counter == 0) {
                         $groupsNames .= CostbenefitprojectionHelper::getGroupName($groups);
                     } else {
                         $groupsNames .= ', ' . CostbenefitprojectionHelper::getGroupName($groups);
                     }
                     $counter++;
                 }
                 $item->groups = $groupsNames;
             }
         }
     }
     // set selection value to a translatable value
     if (CostbenefitprojectionHelper::checkArray($items)) {
         foreach ($items as $nr => &$item) {
             // convert type
             $item->type = $this->selectionTranslation($item->type, 'type');
             // convert location
             $item->location = $this->selectionTranslation($item->location, 'location');
         }
     }
     // return items
     return $items;
 }
開發者ID:namibia,項目名稱:CBP-Joomla-3-Component,代碼行數:50,代碼來源:help_documents.php


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