Class humhub\modules\user\models\Group

Inheritancehumhub\modules\user\models\Group » humhub\components\ActiveRecord » yii\db\ActiveRecord
ImplementsSerializable
Subclasseshumhub\modules\admin\models\GroupSearch, humhub\modules\user\models\forms\EditGroupForm

This is the model class for table "group".

Public Methods

Hide inherited methods

MethodDescriptionDefined By
addUser() Adds a user to the group. This function will skip if the user is already a member of the group. humhub\modules\user\models\Group
attributeLabels() humhub\modules\user\models\Group
beforeSave() humhub\modules\user\models\Group
getAdminGroup() Returns the admin group. humhub\modules\user\models\Group
getAdminGroupId() humhub\modules\user\models\Group
getCreatedBy() Relation to User defined in created_by attribute humhub\components\ActiveRecord
getDefaultSpace() humhub\modules\user\models\Group
getDirectoryGroups() humhub\modules\user\models\Group
getErrorMessage() Returns the errors as string for all attribute or a single attribute. humhub\components\ActiveRecord
getFileManager() Returns the file manager for this record humhub\components\ActiveRecord
getGroupUser() Returns the GroupUser relation for a given user. humhub\modules\user\models\Group
getGroupUsers() Returns all GroupUser relations for this group as ActiveQuery. humhub\modules\user\models\Group
getManager() Returns all user which are defined as manager in this group as ActiveQuery. humhub\modules\user\models\Group
getRegistrationGroups() Returns groups which are available in user registration humhub\modules\user\models\Group
getSpace() humhub\modules\user\models\Group
getUniqueId() Returns a unique id for this record/model humhub\components\ActiveRecord
getUpdatedBy() Relation to User defined in updated_by attribute humhub\components\ActiveRecord
getUsers() Returns all member user of this group as ActiveQuery humhub\modules\user\models\Group
hasManager() Checks if this group has at least one Manager assigned. humhub\modules\user\models\Group
hasUsers() Checks if this group has at least one user assigned. humhub\modules\user\models\Group
isManager() humhub\modules\user\models\Group
isMember() humhub\modules\user\models\Group
notifyAdminsForUserApproval() Notifies groups admins for approval of new user via e-mail. humhub\modules\user\models\Group
removeUser() Removes a user from the group. humhub\modules\user\models\Group
rules() humhub\modules\user\models\Group
serialize() Serializes attributes and oldAttributes of this record. humhub\components\ActiveRecord
tableName() humhub\modules\user\models\Group
unserialize() Unserializes the given string, calls the init() function and sets the attributes and oldAttributes. humhub\components\ActiveRecord
validateShowAtRegistration() humhub\modules\user\models\Group

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
SCENARIO_EDIT 'edit' humhub\modules\user\models\Group

Method Details

addUser() public method

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
attributeLabels() public method

public void attributeLabels ( )
beforeSave() public method

public void beforeSave ( $insert )
$insert
getAdminGroup() public static method

Returns the admin group.

public static humhub\modules\user\models\Group getAdminGroup ( )
getAdminGroupId() public static method

public static void getAdminGroupId ( )
getDefaultSpace() public method

public null|humhub\modules\space\models\Space getDefaultSpace ( )
getDirectoryGroups() public static method

public static array|\yii\db\ActiveRecord[] getDirectoryGroups ( )
getGroupUser() public method

Returns the GroupUser relation for a given user.

public humhub\modules\user\models\GroupUser|null getGroupUser ( $user )
$user humhub\modules\user\models\User|string
getGroupUsers() public method

Returns all GroupUser relations for this group as ActiveQuery.

public \yii\db\ActiveQuery getGroupUsers ( )
getManager() public method

Returns all user which are defined as manager in this group as ActiveQuery.

public \yii\db\ActiveQuery getManager ( )
getRegistrationGroups() public static method

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

getSpace() public method

public \yii\db\ActiveQuery getSpace ( )
getUsers() public method

Returns all member user of this group as ActiveQuery

public humhub\modules\user\components\ActiveQueryUser getUsers ( )
hasManager() public method

Checks if this group has at least one Manager assigned.

public boolean hasManager ( )
hasUsers() public method

Checks if this group has at least one user assigned.

public boolean hasUsers ( )
isManager() public method

public boolean isManager ( $user )
$user
isMember() public method

public boolean isMember ( $user )
$user
notifyAdminsForUserApproval() public static method

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
removeUser() public method

Removes a user from the group.

public boolean removeUser ( $user )
$user humhub\modules\user\models\User|string

UserId or user model

rules() public method

public void rules ( )
tableName() public static method

public static void tableName ( )
validateShowAtRegistration() public method

public void validateShowAtRegistration ( $attribute, $params )
$attribute
$params