Actions

API16

JInstaller/getGroupIDFromName

From Joomla! Documentation

< API16:JInstaller
Revision as of 17:54, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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

[Edit Descripton]

Description:JInstaller/getGroupIDFromName

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();
}

[Edit See Also] SeeAlso:JInstaller/getGroupIDFromName

Examples

<CodeExamplesForm />