Class humhub\modules\notification\models\Notification

Inheritancehumhub\modules\notification\models\Notification » humhub\components\ActiveRecord » yii\db\ActiveRecord
ImplementsSerializable

This is the model class for table "notification".

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$group_count integer Number of found grouped notifications humhub\modules\notification\models\Notification
$group_user_count integer Number of involved users of grouped notifications humhub\modules\notification\models\Notification

Public Methods

Hide inherited methods

MethodDescriptionDefined By
beforeSave() humhub\components\ActiveRecord
behaviors() humhub\modules\notification\models\Notification
findGrouped() Finds grouped notifications if $sendWebNotifications is set to 1 we filter only notifications with send_web_notifications setting to 1. humhub\modules\notification\models\Notification
findUnnotifiedInFrontend() Finds all grouped unseen notifications which were not already sent to the frontend. humhub\modules\notification\models\Notification
findUnseen() Finds all grouped unseen notifications for the given user or the current loggedIn user if no User instance is provided. humhub\modules\notification\models\Notification
getBaseModel() Returns the business model of this notification humhub\modules\notification\models\Notification
getClass() Use getBaseModel instead. humhub\modules\notification\models\Notification
getCreatedBy() Relation to User defined in created_by attribute humhub\components\ActiveRecord
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
getModuleNotifications() Returns all available notifications of a module identified by its modulename. humhub\modules\notification\models\Notification
getNotificationClasses() Returns a distinct list of notification classes already in the database. humhub\modules\notification\models\Notification
getOriginator() humhub\modules\notification\models\Notification
getSourceObject() Returns polymorphic relation linked with this notification humhub\modules\notification\models\Notification
getUniqueId() Returns a unique id for this record/model humhub\components\ActiveRecord
getUpdatedBy() Relation to User defined in updated_by attribute humhub\components\ActiveRecord
getUser() humhub\modules\notification\models\Notification
init() humhub\modules\notification\models\Notification
loadMore() Loads a certain amount ($limit) of grouped notifications from a given id set by $from. humhub\modules\notification\models\Notification
rules() humhub\modules\notification\models\Notification
serialize() Serializes attributes and oldAttributes of this record. humhub\components\ActiveRecord
tableName() humhub\modules\notification\models\Notification
unserialize() Unserializes the given string, calls the init() function and sets the attributes and oldAttributes. humhub\components\ActiveRecord

Property Details

$group_count public property

Number of found grouped notifications

public integer $group_count null
$group_user_count public property

Number of involved users of grouped notifications

public integer $group_user_count null

Method Details

behaviors() public method

public void behaviors ( )
findGrouped() public static method

Finds grouped notifications if $sendWebNotifications is set to 1 we filter only notifications with send_web_notifications setting to 1.

public static \yii\db\ActiveQuery findGrouped ( humhub\modules\user\models\User $user null, $sendWebNotifications 1 )
$user humhub\modules\user\models\User|null
$sendWebNotifications integer
findUnnotifiedInFrontend() public static method (available since version 1.2)

Finds all grouped unseen notifications which were not already sent to the frontend.

public static \yii\db\ActiveQuery findUnnotifiedInFrontend ( humhub\modules\user\models\User $user null )
$user humhub\modules\user\models\User
findUnseen() public static method (available since version 1.2)

Finds all grouped unseen notifications for the given user or the current loggedIn user if no User instance is provided.

public static \yii\db\ActiveQuery findUnseen ( humhub\modules\user\models\User $user null )
$user humhub\modules\user\models\User
getBaseModel() public method

Returns the business model of this notification

public humhub\modules\notification\components\BaseNotification getBaseModel ( $params = [] )
$params array
throws \yii\db\IntegrityException
getClass() public method
Deprecated since version 1.2 use [getBaseModel()] instead

Use getBaseModel instead.

public humhub\modules\notification\components\BaseNotification getClass ( $params = [] )
$params array
getModuleNotifications() public static method

Returns all available notifications of a module identified by its modulename.

public static array getModuleNotifications ( )
return array

With format [moduleId => notifications[]]

getNotificationClasses() public static method

Returns a distinct list of notification classes already in the database.

public static void getNotificationClasses ( )
getOriginator() public method

public \yii\db\ActiveQuery getOriginator ( )
return \yii\db\ActiveQuery

The originator user relations

getSourceObject() public method

Returns polymorphic relation linked with this notification

public humhub\components\ActiveRecord getSourceObject ( )
getUser() public method

public \yii\db\ActiveQuery getUser ( )
return \yii\db\ActiveQuery

The receiver of this notification

init() public method

public void init ( )
loadMore() public static method (available since version 1.2)

Loads a certain amount ($limit) of grouped notifications from a given id set by $from.

public static humhub\modules\notification\models\Notification[] loadMore ( $from 0, $limit 6 )
$from integer

Notification id which was the last loaded entry.

$limit integer

Count of results.

rules() public method

public void rules ( )
tableName() public static method

public static void tableName ( )