本文整理汇总了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;
}