PluginEvent

Extends\LimeSurvey\PluginManager\PluginEvent

package

Default

Methods

Constructor for the PluginEvent

__construct(string $event,object $sender = null): \PluginEvent

Arguments

$event

string

Name of the event fired

$sender

object

The object sending the event

Response

\PluginEvent

Appends a new value into the old.

append(string $key,array $value): \PluginEvent

$value has to be an array in this case, since it is assumed that old value was an array. The new and old array value will be merged.

Arguments

$key

string

$value

array

Response

\PluginEvent

Fluent interface

Get a value for the given key.

get(string $key = null,mixed $default = null): mixed

When the value is not set, it will return the given default or null when no default was given.

Arguments

$key

string

$default

mixed

Response

mixed

Return an array of pluginname / PluginEventContent but only when it has content

getAllContent(): array<mixed,\LimeSurvey\PluginManager\PluginEventContent>

Returns content for the given plugin(name)

getContent(\LimeSurvey\PluginManager\PluginBase|string $plugin): \LimeSurvey\PluginManager\PluginEventContent

When there is no content yet, it will return an empty content object.

Arguments

$plugin

\LimeSurvey\PluginManager\PluginBase|string

The plugin we want content for or a string name

Response

\LimeSurvey\PluginManager\PluginEventContent

Return the name of the event

getEventName(): string

Response

string

Return the sender of the event

getSender(): object

Normally the class that fired the event, but can return false when not set.

Response

object

The object sending the event, or false when unknown

Returns true when execution of this event was stopped using $this->stop()

isStopped(): boolean

Response

boolean

Set a key/value pair to be used by plugins hanlding this event.

set(string $key,mixed $value): \PluginEvent

Arguments

$key

string

$value

mixed

Response

\PluginEvent

Fluent interface

Set content for $plugin, replacing any preexisting content

setContent(string|\LimeSurvey\PluginManager\PluginBase $plugin,string $content = null,string $cssClass = null,string $id = null): \LimeSurvey\PluginManager\PluginEventContent

Arguments

$plugin

string|\LimeSurvey\PluginManager\PluginBase

The plugin setting the context or a string name

$content

string

$cssClass

string

$id

string

Response

\LimeSurvey\PluginManager\PluginEventContent

Halt execution of this event by other plugins

stop()

Properties

The name of this event

_event :string
var

Type(s)

string

This array holds the content blocks that plugins generate, idexed by plugin name

_content :array
var

of PluginEventContent

Type(s)

array

The class who fired the event, or null when not set

_sender :object
var

Type(s)

object

When true it prevents delegating the event to other plugins.

_stop :boolean
var

Type(s)

boolean

Internal storage for event data. Can be used to communicate between sender and plugin or between different plugins handling the event.

_parameters :array
var

Type(s)

array