本文整理匯總了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;
}