\Charcoal\Admin\UiFeedbackContainerTrait

Provides methods for collecting feedback messages.

Summary

Methods
Properties
Constants
hasFeedbacks()
numFeedbacks()
feedbacks()
addFeedback()
clearFeedback()
No public properties found
No constants found
resolveFeedbackLevel()
$feedbacks
N/A
No private methods found
No private properties found
N/A

Properties

$feedbacks

$feedbacks : array

Collection of feedback.

Type

array

Methods

hasFeedbacks()

hasFeedbacks() : boolean

Determine if there's feedback.

Returns

boolean

numFeedbacks()

numFeedbacks() : integer

Count feedback.

Returns

integer

feedbacks()

feedbacks(string|null  $level = null) : array

Retrieve the feedback collection.

Optionally retrieve only the feedback for the given level.

Parameters

string|null $level

Optional level to filter collection.

Throws

\InvalidArgumentException

If the feedback level is invalid.

Returns

array

addFeedback()

addFeedback(string  $level, mixed  $message) : \Charcoal\Admin\Ui\FeedbackContainerTrait

Add feedback.

Parameters

string $level

The feedback level.

mixed $message

The feedback message.

Returns

\Charcoal\Admin\Ui\FeedbackContainerTrait

Chainable

resolveFeedbackLevel()

resolveFeedbackLevel(string  $level) : string

Resolve the given feedback level.

Parameters

string $level

The feedback level.

Returns

string —

The level.