Class humhub\modules\user\models\UserFilter

Inheritancehumhub\modules\user\models\UserFilter » humhub\modules\user\models\User » humhub\modules\content\components\ContentContainerActiveRecord » humhub\components\ActiveRecord » yii\db\ActiveRecord
ImplementsSerializable, humhub\modules\search\interfaces\Searchable, yii\web\IdentityInterface

Special user model class for the purpose of searching users.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__get() humhub\modules\user\models\User
addKeywordFilter() humhub\modules\user\models\UserFilter
addQueryFilter() humhub\modules\user\models\UserFilter
afterDelete() humhub\modules\content\components\ContentContainerActiveRecord
afterSave() humhub\modules\content\components\ContentContainerActiveRecord
attributeLabels() humhub\modules\user\models\User
beforeDelete() Before Delete of a User humhub\modules\user\models\User
beforeSave() humhub\components\ActiveRecord
behaviors() humhub\modules\user\models\User
can() Checks if the current user has the given Permission on this ContentContainerActiveRecord. humhub\modules\content\components\ContentContainerActiveRecord
canAccessPrivateContent() Checks if the user is allowed to access private content in this container humhub\modules\content\components\ContentContainerActiveRecord
canApproveUsers() User can approve other users humhub\modules\user\models\User
createUrl() Creates url in content container scope. humhub\modules\content\components\ContentContainerActiveRecord
filter() Returns an array of user models filtered by a $keyword and $permission. These filters are added to the provided $query. The $keyword filter can be used to filter the users by email, username, firstname, lastname and title. By default this functions does not consider inactive user. humhub\modules\user\models\UserFilter
filterByPermission() Returns a subset of the given array containing all users of the given set which are permitted. If the permission is null this method returns the humhub\modules\user\models\UserFilter
find() humhub\modules\user\models\User
findByGuid() humhub\modules\content\components\ContentContainerActiveRecord
findIdentity() humhub\modules\user\models\User
findIdentityByAccessToken() humhub\modules\user\models\User
forUser() Returns a UserFilter instance for the given $user or the current user identity if $user is not provided. humhub\modules\user\models\UserFilter
getAuthKey() humhub\modules\user\models\User
getAuths() humhub\modules\user\models\User
getContentContainerRecord() Returns the related ContentContainer model (e.g. Space or User) humhub\modules\content\components\ContentContainerActiveRecord
getCreatedBy() Relation to User defined in created_by attribute humhub\components\ActiveRecord
getCurrentPassword() humhub\modules\user\models\User
getDefaultContentVisibility() Determines the default visibility of this container type. humhub\modules\content\components\ContentContainerActiveRecord
getDisplayName() Returns the display name of content container humhub\modules\content\components\ContentContainerActiveRecord
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
getFriends() Returns all user this user is related as friend as ActiveQuery. humhub\modules\user\models\User
getFriendsByFilter() Search for all active friends by the given keyword and permission humhub\modules\user\models\UserFilter
getGroupUsers() Returns all GroupUser relations of this user as ActiveQuery humhub\modules\user\models\User
getGroups() Returns all Group relations of this user as ActiveQuery humhub\modules\user\models\User
getHttpSessions() humhub\modules\user\models\User
getId() humhub\modules\user\models\User
getManagerGroups() Returns all Groups this user is a maanger of as ActiveQuery. humhub\modules\user\models\User
getManagerGroupsUser() Returns all GroupUser relations this user is a manager of as ActiveQuery. humhub\modules\user\models\User
getModuleManager() Returns a ModuleManager humhub\modules\content\components\ContentContainerActiveRecord
getPermissionManager() Returns a ContentContainerPermissionManager instance for this ContentContainerActiveRecord as permission object and the given user (or current user if not given) as permission subject. humhub\modules\content\components\ContentContainerActiveRecord
getProfile() humhub\modules\user\models\User
getProfileBannerImage() Returns the Profile Banner Image Object for this Content Base humhub\modules\content\components\ContentContainerActiveRecord
getProfileImage() Returns the Profile Image Object for this Content Base humhub\modules\content\components\ContentContainerActiveRecord
getSearchAttributes() Returns an array of informations used by search subsystem. humhub\modules\user\models\User
getSpaces() humhub\modules\user\models\User
getTags() Returns an array with assigned Tags humhub\modules\user\models\User
getUniqueId() Returns a unique id for this record/model humhub\components\ActiveRecord
getUpdatedBy() Relation to User defined in updated_by attribute humhub\components\ActiveRecord
getUrl() Should be overwritten by implementation humhub\modules\content\components\ContentContainerActiveRecord
getUserByFilter() Searches for all active users by the given keyword and permission. humhub\modules\user\models\UserFilter
getUserGroup() Returns user group for the given $user or current logged in user if no $user instance was provided. humhub\modules\content\components\ContentContainerActiveRecord
getUserGroups() Returns user groups humhub\modules\content\components\ContentContainerActiveRecord
getUserPickerResult() Default implementation for user picker filter. humhub\modules\user\models\UserFilter
getWallOut() Returns the wall output for this content container. humhub\modules\content\components\ContentContainerActiveRecord
hasGroup() Checks if the user has at least one group assigned. humhub\modules\user\models\User
hasTags() Checks if user has tags humhub\modules\user\models\User
is() Checks if the given $user instance shares the same identity with this user instance. humhub\modules\user\models\User
isActive() humhub\modules\user\models\User
isArchived() Returns weather or not the contentcontainer is archived. (Default false). humhub\modules\content\components\ContentContainerActiveRecord
isCurrentUser() Checks if this user is the current logged in user. humhub\modules\user\models\User
isSystemAdmin() Checks if user is system administrator humhub\modules\user\models\User
isVisible() Specifies whether the user should appear in user lists or in the search. humhub\modules\user\models\User
isVisibleFor() Checks the current visibility setting of this ContentContainerActiveRecord humhub\modules\content\components\ContentContainerActiveRecord
rules() humhub\modules\user\models\User
scenarios() humhub\modules\user\models\User
serialize() Serializes attributes and oldAttributes of this record. humhub\components\ActiveRecord
setUpApproved() humhub\modules\user\models\User
softDelete() humhub\modules\user\models\User
tableName() humhub\modules\user\models\User
unserialize() Unserializes the given string, calls the init() function and sets the attributes and oldAttributes. humhub\components\ActiveRecord
updateSearch() Update user record in search index humhub\modules\user\models\User
validateAuthKey() humhub\modules\user\models\User

Events

Hide inherited events

EventTypeDescriptionDefined By
EVENT_BEFORE_SOFT_DELETE humhub\modules\user\events\UserEvent An event that is triggered when the user is soft deleted (without contents) and also before complete deletion. humhub\modules\user\models\User
EVENT_CHECK_VISIBILITY \humhub\modules\user\models\Event An event that is triggered when the user visibility is checked via isVisible(). humhub\modules\user\models\User

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
STATUS_DISABLED 0 User Status Flags humhub\modules\user\models\User
STATUS_ENABLED 1 humhub\modules\user\models\User
STATUS_NEED_APPROVAL 2 humhub\modules\user\models\User
STATUS_SOFT_DELETED 3 humhub\modules\user\models\User
USERGROUP_FRIEND 'u_friend' humhub\modules\user\models\User
USERGROUP_GUEST 'u_guest' humhub\modules\user\models\User
USERGROUP_SELF 'u_self' User Groups humhub\modules\user\models\User
USERGROUP_USER 'u_user' humhub\modules\user\models\User
VISIBILITY_ALL 2 humhub\modules\user\models\User
VISIBILITY_REGISTERED_ONLY 1 Visibility Modes humhub\modules\user\models\User

Method Details

addKeywordFilter() public static method

public static void addKeywordFilter ( $query, $keyword )
$query
$keyword
addQueryFilter() public static method

public static void addQueryFilter ( $query, $keywords null, $maxResults null, $active null )
$query
$keywords
$maxResults
$active
filter() public static method

Returns an array of user models filtered by a $keyword and $permission. These filters are added to the provided $query. The $keyword filter can be used to filter the users by email, username, firstname, lastname and title. By default this functions does not consider inactive user.

public static \humhub\modules\user\models\type filter ( $query, $keywords null, $maxResults null, $permission null, $active null )
$query \humhub\modules\user\models\type
$keywords \humhub\modules\user\models\type
$maxResults \humhub\modules\user\models\type
$permission \humhub\modules\user\models\type
$active \humhub\modules\user\models\type
filterByPermission() public static method

Returns a subset of the given array containing all users of the given set which are permitted. If the permission is null this method returns the

public static \humhub\modules\user\models\type filterByPermission ( $users, $permission )
$users \humhub\modules\user\models\type
$permission \humhub\modules\user\models\type
forUser() public static method

Returns a UserFilter instance for the given $user or the current user identity if $user is not provided.

public static \humhub\modules\user\models\type forUser ( $user null )
$user \humhub\modules\user\models\type
getFriendsByFilter() public method

Search for all active friends by the given keyword and permission

public \humhub\modules\user\models\type getFriendsByFilter ( $keywords null, $maxResults null, $permission null )
$keywords \humhub\modules\user\models\type

Search keyword

$maxResults \humhub\modules\user\models\type
$permission \humhub\modules\user\models\type
getUserByFilter() public static method

Searches for all active users by the given keyword and permission.

public static \humhub\modules\user\models\type getUserByFilter ( $keywords null, $maxResults null, $permission null )
$keywords \humhub\modules\user\models\type
$maxResults \humhub\modules\user\models\type
$permission \humhub\modules\user\models\type
getUserPickerResult() public method
Deprecated since 1.2 use

Default implementation for user picker filter.

public \humhub\modules\user\models\type getUserPickerResult ( $keywords null, $maxResults null, $friendsOnly false, $permission null )
$keywords \humhub\modules\user\models\type
$maxResults \humhub\modules\user\models\type
$friendsOnly \humhub\modules\user\models\type
$permission \humhub\modules\user\models\type