Back to UserGroupsHelper class

Method get

public mixed
get
(mixed $id)
Get a user group by its id.
Parameters
  • int $id Group identifier
Returns
  • mixed stdClass on success. False otherwise
Since
  • 3.6.3

Method get - Source code

/**
 * Get a user group by its id.
 *
 * @param   integer  $id  Group identifier
 *
 * @return  mixed  stdClass on success. False otherwise
 *
 * @since   3.6.3
 */
public function get($id)
{
    if ($this->has($id)) {
        return $this->groups[$id];
    }
    // Singleton will load groups as they are requested
    if ($this->isSingleton()) {
        $this->groups[$id] = $this->load($id);
        return $this->groups[$id];
    }
    return false;
}