Class humhub\modules\user\models\Group
Inheritance | humhub\modules\user\models\Group » humhub\components\ActiveRecord » yii\db\ActiveRecord |
---|---|
Implements | Serializable |
Subclasses | humhub\modules\admin\models\GroupSearch, humhub\modules\user\models\forms\EditGroupForm |
This is the model class for table "group".
Public Methods
Constants
Constant | Value | Description | Defined By |
---|---|---|---|
SCENARIO_EDIT | 'edit' | humhub\modules\user\models\Group |
Method Details
Adds a user to the group. This function will skip if the user is already a member of the group.
public void addUser ( $user, $isManager = false ) | ||
$user | humhub\modules\user\models\User | User id or user model |
$isManager | boolean | Mark as group manager |
throws | \yii\base\InvalidConfigException |
---|
public void attributeLabels ( ) |
public void beforeSave ( $insert ) | ||
$insert |
Returns the admin group.
public static humhub\modules\user\models\Group getAdminGroup ( ) |
public static void getAdminGroupId ( ) |
public null|humhub\modules\space\models\Space getDefaultSpace ( ) |
public static array|\yii\db\ActiveRecord[] getDirectoryGroups ( ) |
Returns the GroupUser relation for a given user.
public humhub\modules\user\models\GroupUser|null getGroupUser ( $user ) | ||
$user | humhub\modules\user\models\User|string |
Returns all GroupUser relations for this group as ActiveQuery.
public \yii\db\ActiveQuery getGroupUsers ( ) |
Returns all user which are defined as manager in this group as ActiveQuery.
public \yii\db\ActiveQuery getManager ( ) |
Returns groups which are available in user registration
public static humhub\modules\user\models\Group[] getRegistrationGroups ( ) | ||
return | humhub\modules\user\models\Group[] | The groups which can be selected in registration |
---|
public \yii\db\ActiveQuery getSpace ( ) |
Returns all member user of this group as ActiveQuery
public humhub\modules\user\components\ActiveQueryUser getUsers ( ) |
Checks if this group has at least one Manager assigned.
public boolean hasManager ( ) |
Checks if this group has at least one user assigned.
public boolean hasUsers ( ) |
public boolean isManager ( $user ) | ||
$user |
public boolean isMember ( $user ) | ||
$user |
Notifies groups admins for approval of new user via e-mail.
This should be done after a new user is created and approval is required.
public static true|void notifyAdminsForUserApproval ( $user ) | ||
$user | humhub\modules\user\models\User |
Removes a user from the group.
public boolean removeUser ( $user ) | ||
$user | humhub\modules\user\models\User|string | UserId or user model |
public void rules ( ) |
public static void tableName ( ) |
public void validateShowAtRegistration ( $attribute, $params ) | ||
$attribute | ||
$params |