Abstract Class humhub\modules\notification\components\NotificationCategory

Inheritancehumhub\modules\notification\components\NotificationCategory » yii\base\BaseObject
Subclasseshumhub\modules\admin\notifications\AdminNotificationCategory, humhub\modules\comment\notifications\CommentNotificationCategory, humhub\modules\content\notifications\ContentCreatedNotificationCategory, humhub\modules\friendship\notifications\FriendshipNotificationCategory, humhub\modules\like\notifications\LikeNotificationCategory, humhub\modules\space\notifications\SpaceMemberNotificationCategory, humhub\modules\user\notifications\FollowedNotificationCategory, humhub\modules\user\notifications\MentionedNotificationCategory

NotificationCategories are used to group different notifications in views and configure the notifications in the notification settings.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
getDefaultSetting() Returns the default enabled settings for the given $target. humhub\modules\notification\components\NotificationCategory
getDescription() Returns a group description humhub\modules\notification\components\NotificationCategory
getFixedSettings() Returns an array of target ids, which are not editable. humhub\modules\notification\components\NotificationCategory
getTitle() Returns a human readable title of this category humhub\modules\notification\components\NotificationCategory
init() humhub\modules\notification\components\NotificationCategory
isFixedSetting() Checks if the given notification target is fixed for this category. humhub\modules\notification\components\NotificationCategory
isVisible() Determines if this category is visible for the given $user. humhub\modules\notification\components\NotificationCategory

Property Details

$id public property

The category id

public string $id null
$sortOrder public property

Used to sort categories

public integer $sortOrder PHP_INT_MAX

Method Details

getDefaultSetting() public method

Returns the default enabled settings for the given $target.

In case the $target is unknown, subclasses can either return $target->defaultSetting or another default value.

public boolean getDefaultSetting ( humhub\modules\notification\targets\BaseTarget $target )
$target humhub\modules\notification\targets\BaseTarget
getDescription() public abstract method

Returns a group description

public abstract void getDescription ( )
getFixedSettings() public method

Returns an array of target ids, which are not editable.

public void getFixedSettings ( )
getTitle() public abstract method

Returns a human readable title of this category

public abstract void getTitle ( )
init() public method

public void init ( )
throws \yii\base\InvalidConfigException
isFixedSetting() public method

Checks if the given notification target is fixed for this category.

public \humhub\modules\notification\components\type isFixedSetting ( humhub\modules\notification\targets\BaseTarget $target )
$target \humhub\modules\notification\components\type
isVisible() public method

Determines if this category is visible for the given $user.

This can be used if a category is only visible for users with certian permissions.

Note if no user is given this function should return true in most cases, otherwise this category won't be visible in the global notification settings.

public boolean isVisible ( humhub\modules\user\models\User $user null )
$user humhub\modules\user\models\User