# \hhu\z\controllers\componentsNotificationComponent

Component to handle user notifications

## Summary

Methods
Properties
Constants
load()
factory()
__construct()
addNotification()
getNotifications()
clearNotifications()
No public properties found
TYPE_ACHIEVEMENT
TYPE_LEVELUP
SESSION_KEY
No protected methods found
No protected properties found
N/A
getClassName()
No private properties found
N/A

File
  controllers/components/NotificationComponent.inc
Package
  Default
Class hierarchy
  \nre\core\Component
  \hhu\z\controllers\components\NotificationComponent

## Tags

author | Oliver Hanraths oliver.hanraths@uni-duesseldorf.de

## Constants

### TYPE_ACHIEVEMENT

    TYPE_ACHIEVEMENT

Type: Achievement

#

## Tags

None found

### TYPE_LEVELUP

    TYPE_LEVELUP

Type: Level-up

#

## Tags

None found

### SESSION_KEY

    SESSION_KEY

Key for Session-Array to store notifications in

#

## Tags

None found

## Methods

### load()

    load(string  $componentName)

Load the class of a Component.

#### Parameters

string | $componentName | Name of the Component to load

#### Throws

\nre\exceptions\ComponentNotFoundException
\nre\exceptions\ComponentNotValidException

#

static

Inherited from
  \nre\core\Component

## Tags

None found

### factory()

    factory(string  $componentName)

Instantiate a Component (Factory Pattern).

#### Parameters

string | $componentName | Name of the Component to instantiate

#

static

Inherited from
  \nre\core\Component

## Tags

None found

### __construct()

    __construct()

Construct a new Notification-component.

#

## Tags

None found

### addNotification()

    addNotification(string  $type, string  $message, string  $link = null, string  $image = null)

Add a notification.

#### Parameters

string | $type | Type of notification
string | $message | Message to display
string | $link | Optional URL to link to
string | $image | Optional URL of image to display

#

## Tags

None found

### getNotifications()

    getNotifications() : array

Get all registered notifiactions and clear them.

#### Returns

array —

List of existing notifications

#

## Tags

None found

### clearNotifications()

    clearNotifications()

Clear all notifications currently registered

#

## Tags

None found

### getClassName()

    getClassName(string  $componentName) : string

Determine the classname for the given Component name.

#### Parameters

string | $componentName | Component name to get classname of

#### Returns

string —

Classname for the Component name

#

static

Inherited from
  \nre\core\Component

## Tags

None found

### NotificationComponent.inc