Class humhub\modules\space\notifications\ApprovalRequest

Inheritancehumhub\modules\space\notifications\ApprovalRequest » humhub\modules\notification\components\BaseNotification » humhub\components\SocialActivity » yii\base\BaseObject
ImplementsSerializable, humhub\components\rendering\Viewable
Available since version0.5


Public Methods

Hide inherited methods

MethodDescriptionDefined By
about() Builder function for the source. humhub\modules\notification\components\BaseNotification
asArray() Returns an array representation of this notification. humhub\modules\notification\components\BaseNotification
beforeMailSend() This method is invoked right before a mail will be send for this notificatoin humhub\modules\notification\components\BaseNotification
category() Returns a new NotificationCategory instance. humhub\modules\space\notifications\ApprovalRequest
delete() Deletes this notification humhub\modules\notification\components\BaseNotification
from() Builder function for the originator. humhub\modules\notification\components\BaseNotification
getAsHtml() Use html() instead humhub\modules\notification\components\BaseNotification
getAsText() Use text() instead humhub\modules\notification\components\BaseNotification
getCategory() Returns the notification category instance. If no category class is set (default) the default notification settings can't be overwritten. humhub\modules\notification\components\BaseNotification
getContent() Returns the related content instance in case the source is of type ContentOwner. humhub\components\SocialActivity
getContentContainer() Determines if the activity source is related to an ContentContainer. humhub\components\SocialActivity
getContentInfo() Build info text about a content humhub\components\SocialActivity
getContentName() Returns the content name of $content or if not $content is provided of the notification source. humhub\components\SocialActivity
getContentPlainTextPreview() humhub\components\SocialActivity
getContentPreview() Returns a short preview text of the content. The max length can be defined by setting $maxLength (25 by default). humhub\components\SocialActivity
getGroupKey() Returns a key for grouping notifications. humhub\modules\notification\components\BaseNotification
getGroupLastUsers() Returns the last users of a grouped notification humhub\modules\notification\components\BaseNotification
getGroupUserDisplayNames() Returns the combined display names of a grouped notification. humhub\modules\notification\components\BaseNotification
getMailSubject() Returns the mail subject which will be used in the notification e-mail humhub\modules\space\notifications\ApprovalRequest
getSpace() humhub\components\SocialActivity
getSpaceId() humhub\components\SocialActivity
getUrl() Url of the origin of this notification If source is a Content / ContentAddon / ContentContainer this will automatically generated. humhub\components\SocialActivity
getViewName() humhub\components\rendering\Viewable
getViewParams() Returns an array of view parameter, required for rendering. humhub\modules\space\notifications\ApprovalRequest
hasContent() Determines if this activity is related to a content. This is the case if the activitiy source is of type ContentOwner. humhub\components\SocialActivity
html() Should be overwritten by subclasses for a html representation of the notification. humhub\modules\space\notifications\ApprovalRequest
init() humhub\components\SocialActivity
instance() Static initializer should be prefered over new initialization, since it makes use of Yii::createObject dependency injection/configuration. humhub\components\SocialActivity
isOriginator() Checks if the given $user is the originator of this notification. humhub\modules\notification\components\BaseNotification
json() humhub\components\rendering\Viewable
markAsSeen() Marks notification as seen humhub\modules\notification\components\BaseNotification
render() Renders the Notificaiton for the given notification target. humhub\modules\notification\components\BaseNotification
saveRecord() Creates the Notification instance of the current BaseNotification type for the given $user. humhub\modules\notification\components\BaseNotification
send() Sends this notification to all notification targets of the given User. humhub\modules\notification\components\BaseNotification
sendBulk() Sends this notification to a set of users. humhub\modules\notification\components\BaseNotification
serialize() Serializes the $source and $originator fields. humhub\modules\space\notifications\ApprovalRequest
text() humhub\components\rendering\Viewable
unserialize() Unserializes the given string, calls the init() function and sets the $source and $originator fields (and $record indirectyl). humhub\modules\space\notifications\ApprovalRequest
validate() Validates the existence of required attributes humhub\components\SocialActivity
withMessage() Sets the approval request message for this notification. humhub\modules\space\notifications\ApprovalRequest

Property Details

$markAsSeenOnClick public property

Automatically mark notification as seen after click on it

public boolean $markAsSeenOnClick false
$message public property
public $message null
$moduleId public property

The module id which this activity belongs to (required)

public string $moduleId 'space'
$viewName public property

View name used for rendering the activity

public string $viewName 'approval'

Method Details

category() public method

Returns a new NotificationCategory instance.

This function should be overwritten by subclasses to append this BaseNotification to the returned category. If no category instance is returned, the BaseNotification behavriour (targets) will not be configurable.

public humhub\modules\notification\components\NotificationCategory category ( )
getMailSubject() public method

Returns the mail subject which will be used in the notification e-mail

public string getMailSubject ( )
return string

The subject

getViewParams() public method

Returns an array of view parameter, required for rendering.

public void getViewParams ( $params = [] )
$params array
html() public method

Should be overwritten by subclasses for a html representation of the notification.

public string html ( )
serialize() public method

Serializes the $source and $originator fields.

public string serialize ( )
unserialize() public method

Unserializes the given string, calls the init() function and sets the $source and $originator fields (and $record indirectyl).

public void unserialize ( $serialized )
$serialized string
withMessage() public method

Sets the approval request message for this notification.

public void withMessage ( $message )
$message string