Actions

API16

JInstaller/getGroupIDFromName

From Joomla! Documentation

< API16:JInstaller
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Get a group ID from a given name

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax

getGroupIDFromName($groupname)
Parameter Name Default Value Description
$groupname Name of group to find

Returns

int the group id of the user, false on error

Defined in

libraries/joomla/installer/installer.php

Importing

jimport( 'joomla.installer.installer' );

Source Body

function getGroupIDFromName($groupname)
{
        $dbo = $this->getDBO();
        $dbo->setQuery('SELECT id FROM #__usergroups WHERE title = "'. $dbo->getEscaped($groupname) .'"');
        return $dbo->loadResult();
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />