Redaxscript\Module::getNotification PHP Method

getNotification() public method

get message from notification
Since: 3.0.0
public getNotification ( string $type = null ) : mixed
$type string type of the notification
return mixed
    public function getNotification($type = null)
    {
        if (array_key_exists($type, self::$_notificationArray)) {
            return self::$_notificationArray[$type];
        } else {
            if (!$type) {
                return self::$_notificationArray;
            }
        }
        return false;
    }

Usage Example

Example #1
0
 /**
  * testGetInvalid
  *
  * @since 2.1.0
  */
 public function testGetInvalid()
 {
     /* setup */
     $module = new Module();
     /* actual */
     $actual = $module->getNotification('invalidKey');
     /* compare */
     $this->assertFalse($actual);
 }