\System\Model\TablePluginsTable

Represents "plugins" database table.

Summary

Methods
Properties
Constants
implementedEvents()
initialize()
settingsValidate()
settingsDefaultValues()
beforeSave()
afterSave()
afterDelete()
trigger()
eventDispatcher()
triggered()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

implementedEvents()

implementedEvents() : array

Get the Model callbacks this table is interested in.

Returns

array

initialize()

initialize(array $config) : void

Initialize a table instance. Called after the constructor.

Parameters

array $config

Configuration options passed to the constructor

settingsValidate()

settingsValidate(\Cake\Event\Event $event, array $data, \ArrayObject $options) : void

Validates plugin settings before persisted in DB.

Parameters

\Cake\Event\Event $event

The event that was triggered

array $data

Information to be validated

\ArrayObject $options

Options given to pathEntity()

settingsDefaultValues()

settingsDefaultValues(\Cake\Event\Event $event, \Cake\ORM\Entity $plugin) : array

Here we set default values for plugin's settings.

Triggers the Plugin.<PluginName>.settingsDefaults event, event listeners should catch the event and return an array as key => value with default values.

Parameters

\Cake\Event\Event $event

The event that was triggered

\Cake\ORM\Entity $plugin

The plugin entity where to put those values

Returns

array

beforeSave()

beforeSave(\Cake\Event\Event $event, \Cake\ORM\Entity $plugin, \ArrayObject $options) : void

Set plugin's load ordering to LAST if it's a new plugin being installed.

Parameters

\Cake\Event\Event $event

The event that was triggered

\Cake\ORM\Entity $plugin

The Plugin entity being saved

\ArrayObject $options

The options passed to the save method

afterSave()

afterSave(\Cake\Event\Event $event, \Cake\ORM\Entity $plugin, \ArrayObject $options) : void

This method automatically regenerates system's snapshot.

Parameters

\Cake\Event\Event $event

The event that was triggered

\Cake\ORM\Entity $plugin

The Plugin entity that was saved

\ArrayObject $options

The options passed to the save method

afterDelete()

afterDelete(\Cake\Event\Event $event, \Cake\ORM\Entity $plugin, \ArrayObject $options) : void

This method automatically regenerates system's snapshot.

Parameters

\Cake\Event\Event $event

The event that was triggered

\Cake\ORM\Entity $plugin

The Plugin entity that was deleted

\ArrayObject $options

the options passed to the delete method

trigger()

trigger(array|string $eventName) : \Cake\Event\Event

Triggers the given event name. This method provides a shortcut for:

$this->trigger('EventName', $arg1, $arg2, ..., $argn);

You can provide a subject to use by passing an array as first arguments where the first element is the event name and the second one is the subject, if no subject is given $this will be used by default:

$this->trigger(['GetTime', new MySubject()], $arg_0, $arg_1, ..., $arg_n);

You can also indicate an EventDispatcher instance to use by prefixing the event name with <InstanceName>::, for instance:

$this->trigger('Blog::EventName', $arg1, $arg2, ..., $argn);

This will use the EventDispacher instance named Blog and will trigger the event EventName within that instance.

Parameters

array|string $eventName

The event name to trigger

Returns

\Cake\Event\Event —

The event object that was fired

eventDispatcher()

eventDispatcher(string $name) : \QuickApps\Event\EventDispatcher

Gets an instance of the given Event Dispatcher name.

Usage:

$this->eventDispatcher('myDispatcher')
    ->trigger('MyEventName', $argument)
    ->result;

Parameters

string $name

Name of the dispatcher to get, defaults to 'default'

Returns

\QuickApps\Event\EventDispatcher

triggered()

triggered(string|null $eventName) : integer|array

Retrieves the number of times an event was triggered, or the complete list of events that were triggered.

Parameters

string|null $eventName

The name of the event, if null returns the entire list of event that were fired

Returns

integer|array