Свойство | Тип | Описание | |
---|---|---|---|
$container | string | NotificationBag container name. | |
$defaultFormat | string | Default format for all message types. | |
$formats | array | Default formats for types. | |
$groupForRender | array | Sequence of how messages should be rendered by its type. | |
$matcher | array | Array of matcher for extracting types. | |
$notification | Krucas\Notification\Notification | Notification library instance. | |
$notifications | Krucas\Notification\Collection | null | Collection to store all instant notification messages. | |
$types | array | Available message types in container. |
Метод | Описание | |
---|---|---|
__call ( $name, $arguments ) : |
Execute short version of function calls. | |
__construct ( $container, array $types = [], null $defaultFormat = null, array $formats = [] ) | Creates new NotificationBag object. | |
__toString ( ) : string | Convert the Bag to its string representation. | |
add ( $type, string | Krucas\Notification\Message | Closure $message, boolean $flash = true, null $format = null ) : |
Adds new notification message to one of collections. | |
addToGrouping ( $type ) : |
Adds type for rendering. | |
addType ( $type ) : |
Add new available type of message to bag. | |
all ( ) : Krucas\Notification\Collection | Returns all messages in bag. | |
clear ( null $type = null ) : |
Clears message for a given type. | |
clearAll ( ) : |
Clears all messages. | |
clearFormat ( $type ) : |
Clear format for a given type. | |
clearFormats ( ) : |
Clear all formats. | |
clearTypes ( ) : |
Resets types values. | |
count ( ) : integer | Count the number of colections. | |
first ( ) : Krucas\Notification\Message | Returns first message object for given type. | |
get ( $type ) : Krucas\Notification\Collection | Returns all messages for given type. | |
getDefaultFormat ( ) : string | Return default format. | |
getFormat ( $type ) : boolean | string | Return format for a given type. | |
getGroupingForRender ( ) : array | Return array with groups list for rendering. | |
getName ( ) : string | Returns assigned container name. | |
getNotification ( ) : Krucas\Notification\Notification | Get notification instance. | |
getTypes ( ) : array | Return available types of messages in container. | |
group ( ) : |
Set order to render types. | |
has ( $type = null ) : boolean | Check if a message is set for given type. | |
removeFromGrouping ( $type ) : |
Removes type from rendering. | |
setDefaultFormat ( $format ) : |
Set default format for all message types. | |
setFormat ( $type, $format ) : |
Set format for a given type. | |
setFormats ( $formats ) : |
Set formats for a given types. | |
setNotification ( Krucas\Notification\Notification $notification ) : void | Set notification instance. | |
show ( null $type = null, null $format = null ) : string | Returns generated output of non flash messages. | |
showAll ( null $format = null ) : string | Renders all messages. | |
toArray ( ) : array | Get the instance as an array. | |
toJson ( integer $options ) : string | Convert the object to its JSON representation. | |
typeIsAvailable ( $type ) : boolean | Determines if type is available in container. | |
unsetNotification ( ) : void | Unset notification instance. |
Метод | Описание | |
---|---|---|
addInstance ( Krucas\Notification\Message $message, string $type, boolean $flash = true, null $format = null ) | Add message by instance. | |
checkFormat ( $format, null $type = null ) : null | Returns valid format. | |
extractType ( $name ) : boolean | array | Extract type from a given string. | |
fireEvent ( $event, $message ) : boolean | Fire event for a given message. | |
getMessagesForRender ( null $type = null ) : Krucas\Notification\Collection | Resolves which messages should be returned for rendering. |
public __toString ( ) : string | ||
Результат | string |
public addToGrouping ( $type ) : |
||
$type | ||
Результат |
public addType ( $type ) : |
||
$type | ||
Результат |
public all ( ) : Krucas\Notification\Collection | ||
Результат | Krucas\Notification\Collection |
protected checkFormat ( $format, null $type = null ) : null | ||
$format | ||
$type | null | |
Результат | null |
public clearAll ( ) : |
||
Результат |
public clearFormat ( $type ) : |
||
$type | ||
Результат |
public clearFormats ( ) : |
||
Результат |
public clearTypes ( ) : |
||
Результат |
protected extractType ( $name ) : boolean | array | ||
$name | ||
Результат | boolean | array |
public first ( ) : Krucas\Notification\Message | ||
Результат | Krucas\Notification\Message |
public get ( $type ) : Krucas\Notification\Collection | ||
$type | ||
Результат | Krucas\Notification\Collection |
public getDefaultFormat ( ) : string | ||
Результат | string |
public getGroupingForRender ( ) : array | ||
Результат | array |
protected getMessagesForRender ( null $type = null ) : Krucas\Notification\Collection | ||
$type | null | |
Результат | Krucas\Notification\Collection |
public getNotification ( ) : Krucas\Notification\Notification | ||
Результат | Krucas\Notification\Notification |
public group ( ) : |
||
Результат |
public removeFromGrouping ( $type ) : |
||
$type | ||
Результат |
public setDefaultFormat ( $format ) : |
||
$format | ||
Результат |
public setFormat ( $type, $format ) : |
||
$type | ||
$format | ||
Результат |
public setFormats ( $formats ) : |
||
$formats | ||
Результат |
public setNotification ( Krucas\Notification\Notification $notification ) : void | ||
$notification | Krucas\Notification\Notification | |
Результат | void |
public typeIsAvailable ( $type ) : boolean | ||
$type | ||
Результат | boolean |
public unsetNotification ( ) : void | ||
Результат | void |
protected string $container | ||
Результат | string |
protected string $defaultFormat | ||
Результат | string |
protected array $groupForRender | ||
Результат | array |
protected array $matcher | ||
Результат | array |
protected Notification,Krucas\Notification $notification | ||
Результат | Krucas\Notification\Notification |
protected Collection,Krucas\Notification|null $notifications | ||
Результат | Krucas\Notification\Collection | null |
protected array $types | ||
Результат | array |