Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
eZUserGroup Class Reference

## Public Member Functions
| __construct ( $id=-1, $fetch=true)
| store ()
| delete ( $id=false)
| get ( $id=-1)
| fill (&$user_group_array)
| id ()
| userEmails ()
| isRoot ()
| setIsRoot ( $value)
| name ( $html=true)
| description ( $html=true)
| groupURL ()
| sessionTimeout ()
| setName ( $value)
| setDescription ( $value)
| setGroupURL ( $url)
| setSessionTimeout ( $value)
| addUser ( $user)

## Static Public Member Functions
static & | getAll ( $as_object=true)
static | getByUser ( $user)
static | isMember ( $user)
static | users ( $GroupID=false, $order="Login", $search=false)

## Public Attributes
| $ID
| $Name
| $Description
| $GroupURL
| $SessionTimeout
| $IsRoot

## Detailed Description

! eZUser eZUserGroup handles user groups.

Example code:

// create a new eZUsergroup object and set some values.
$group = new eZUserGroup();
$group->setName( "Administrator" );
$group->setDescription( "Has root access" );
// store it to the database.
$group->store();
// fetch user group with object id == 1
$group->get( 1 );
// fetch a user with object id == 42
$user = new eZUser();
$user->get( 42 );
// add a user to the user group.
if ( $group->adduser( $user ) )
{
print( "User added to group" );
}
else
{
print( "Error: count not add user." );
}
$group
$group
Definition: admin/articleedit.php:799
eZUserGroup
Definition: ezusergroup.php:66
eZUser
Definition: ezuser.php:76
$user
$user
Definition: user/adlist.php:39

See also
  eZUser eZPermission eZModule eZForgot

TODO

Definition at line 65 of file ezusergroup.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZUserGroup::__construct | ( |  | $id = `-1`,
|  |  | $fetch = `true`
| ) |  |

Constructs a new eZUser object.

If $id is set the object's values are fetched from the database.

Definition at line 74 of file ezusergroup.php.

References $id, $ID, and fill().

## Member Function Documentation

## ◆ addUser()

eZUserGroup::addUser | ( |  | $user | ) |

Adds a user to the current user group.

Returns true if successful, false if not.

Definition at line 481 of file ezusergroup.php.

References $db, $res, $ret, $user, $userID, and eZDB\globalDatabase().

## ◆ delete()

eZUserGroup::delete | ( |  | $id = `false` | ) |

Deletes a eZUserGroup object from the database.

Definition at line 142 of file ezusergroup.php.

References $db, $id, $ID, and eZDB\globalDatabase().

## ◆ description()

eZUserGroup::description | ( |  | $html = `true` | ) |

Returns the user group description.

Definition at line 422 of file ezusergroup.php.

References $Description.

## ◆ fill()

eZUserGroup::fill | ( | & | $user_group_array | ) |

Fills in information to the object taken from the array.

Definition at line 180 of file ezusergroup.php.

References $db, eZDB\globalDatabase(), and Name.

Referenced by __construct(), and get().

## ◆ get()

eZUserGroup::get | ( |  | $id = `-1` | ) |

Fetches the object information from the database.

Definition at line 162 of file ezusergroup.php.

References $db, $id, fill(), and eZDB\globalDatabase().

## ◆ getAll()

static& eZUserGroup::getAll | ( |  | $as_object = `true` | ) |
| static

Returns every user group from the database. The result is returned as an array of eZUserGroup objects.

Definition at line 197 of file ezusergroup.php.

References $db, $group_array, $i, and eZDB\globalDatabase().

## ◆ getByUser()

static eZUserGroup::getByUser | ( |  | $user | ) |
| static

Fetches every group the user is a member of.

The result is returned as an array of eZUserGroup object. An empty array is returned if there are none.

Definition at line 236 of file ezusergroup.php.

References $db, $group_array, $i, $user, $userID, and eZDB\globalDatabase().

## ◆ groupURL()

eZUserGroup::groupURL | ( |  | ) |

Returns the user group url

Definition at line 432 of file ezusergroup.php.

References $GroupURL.

## ◆ id()

eZUserGroup::id | ( |  | ) |

Returns the object ID to the user group.

Definition at line 283 of file ezusergroup.php.

References $ID.

## ◆ isMember()

static eZUserGroup::isMember | ( |  | $user | ) |
| static

Returns true if the user $user is a member of the group $user is of type eZUser

Definition at line 262 of file ezusergroup.php.

References $user, and $userList.

## ◆ isRoot()

eZUserGroup::isRoot | ( |  | ) |

Returns true if this group has root permissions.

Definition at line 395 of file ezusergroup.php.

References $IsRoot.

## ◆ name()

eZUserGroup::name | ( |  | $html = `true` | ) |

Returns the user group name.

Definition at line 411 of file ezusergroup.php.

References $Name, and Name.

## ◆ sessionTimeout()

eZUserGroup::sessionTimeout | ( |  | ) |

Returns the session timeout value in minutes.

Definition at line 440 of file ezusergroup.php.

References $SessionTimeout.

## ◆ setDescription()

eZUserGroup::setDescription | ( |  | $value | ) |

Sets the description of the user group.

Definition at line 456 of file ezusergroup.php.

## ◆ setGroupURL()

eZUserGroup::setGroupURL | ( |  | $url | ) |

Definition at line 461 of file ezusergroup.php.

References $url.

## ◆ setIsRoot()

eZUserGroup::setIsRoot | ( |  | $value | ) |

Sets if this group has root permissions.

Definition at line 403 of file ezusergroup.php.

## ◆ setName()

eZUserGroup::setName | ( |  | $value | ) |

Sets the name of the user group.

Definition at line 448 of file ezusergroup.php.

References Name.

## ◆ setSessionTimeout()

eZUserGroup::setSessionTimeout | ( |  | $value | ) |

Sets the session timeout value, the value is in minutes.

Definition at line 469 of file ezusergroup.php.

## ◆ store()

eZUserGroup::store | ( |  | ) |

Stores or updates a eZUserGroup object in the database.

Definition at line 93 of file ezusergroup.php.

References $db, $name, $query, eZDB\globalDatabase(), and Name.

## ◆ userEmails()

eZUserGroup::userEmails | ( |  | ) |

Returns the email addresses of the users that are members of this group

Definition at line 383 of file ezusergroup.php.

References $db, $mail_array, and eZDB\globalDatabase().

## ◆ users()

static eZUserGroup::users | ( |  | $GroupID = `false`,
|  |  | $order = `"Login"`,
|  |  | $search = `false`
| ) |  |
| static

Returns the users who is a member of the eZUserGroup object.

Definition at line 291 of file ezusergroup.php.

References $db, $GroupID, $item, $order, $query, $ret, $search, $user, $user_array, and eZDB\globalDatabase().

## Member Data Documentation

## ◆ $Description

eZUserGroup::$Description

Definition at line 521 of file ezusergroup.php.

Referenced by description().

## ◆ $GroupURL

eZUserGroup::$GroupURL

Definition at line 522 of file ezusergroup.php.

Referenced by groupURL().

## ◆ $ID

eZUserGroup::$ID

Definition at line 519 of file ezusergroup.php.

Referenced by __construct(), delete(), and id().

## ◆ $IsRoot

eZUserGroup::$IsRoot

Definition at line 524 of file ezusergroup.php.

Referenced by isRoot().

## ◆ $Name

eZUserGroup::$Name

Definition at line 520 of file ezusergroup.php.

Referenced by name().

## ◆ $SessionTimeout

eZUserGroup::$SessionTimeout

Definition at line 523 of file ezusergroup.php.

Referenced by sessionTimeout().

The documentation for this class was generated from the following file:

- ezusergroup.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.