public function getGroups($role = 'all')
	{
		static $groups;

		if (!isset($groups))
		{
			$groups = array(
				'applicants' => array(),
				'invitees'   => array(),
				'members'    => array(),
				'managers'   => array(),
				'all'        => array()
			);
			$groups['all'] = Helper::getGroups($this->get('uidNumber'), 'all', 1);

			if ($groups['all'])
			{
				foreach ($groups['all'] as $item)
				{
					if ($item->registered)
					{
						if (!$item->regconfirmed)
						{
							$groups['applicants'][] = $item;
						}
						else
						{
							if ($item->manager)
							{
								$groups['managers'][] = $item;
							}
							else
							{
								$groups['members'][] = $item;
							}
						}
					}
					else
					{
						$groups['invitees'][] = $item;
					}
				}
			}
		}

		if ($role)
		{
			return (isset($groups[$role])) ? $groups[$role] : false;
		}

		return $groups;
	}
public function getGroups($role = 'all')
	{
		static $groups;

		if (!isset($groups))
		{
			$groups = array(
				'applicants' => array(),
				'invitees'   => array(),
				'members'    => array(),
				'managers'   => array(),
				'all'        => array()
			);
			$groups['all'] = Helper::getGroups($this->get('uidNumber'), 'all', 1);

			if ($groups['all'])
			{
				foreach ($groups['all'] as $item)
				{
					if ($item->registered)
					{
						if (!$item->regconfirmed)
						{
							$groups['applicants'][] = $item;
						}
						else
						{
							if ($item->manager)
							{
								$groups['managers'][] = $item;
							}
							else
							{
								$groups['members'][] = $item;
							}
						}
					}
					else
					{
						$groups['invitees'][] = $item;
					}
				}
			}
		}

		if ($role)
		{
			return (isset($groups[$role])) ? $groups[$role] : false;
		}

		return $groups;
	}
public function getGroups ( $ role = 'all' ) { static $ groups ; if ( ! isset ( $ groups ) ) { $ groups = array ( 'applicants' => array ( ) , 'invitees' => array ( ) , 'members' => array ( ) , 'managers' => array ( ) , 'all' => array ( ) ) ; $ groups [ 'all' ] = Helper :: getGroups ( $ this -> get ( 'uidNumber' ) , 'all' , 1 ) ; if ( $ groups [ 'all' ] ) { foreach ( $ groups [ 'all' ] as $ item ) { if ( $ item -> registered ) { if ( ! $ item -> regconfirmed ) { $ groups [ 'applicants' ] [ ] = $ item ; } else { if ( $ item -> manager ) { $ groups [ 'managers' ] [ ] = $ item ; } else { $ groups [ 'members' ] [ ] = $ item ; } } } else { $ groups [ 'invitees' ] [ ] = $ item ; } } } } if ( $ role ) { return ( isset ( $ groups [ $ role ] ) ) ? $ groups [ $ role ] : false ; } return $ groups ; }
Get the groups for a user

@param   string  $role  The group set to return. Returns all groups if not set
@return  array   Array of groups
Get the groups for a user