Blesta
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • blesta
    • app
      • controllers
      • models
    • components
      • areyouahuman
      • auth
        • motp
        • oath
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • events
        • default
      • exchange
        • rates
          • google
            • finance
          • yahoo
            • finance
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
          • quickbooks
            • invoice
      • json
      • modules
      • net
        • amazon
          • s3
        • http
        • net
          • geo
            • ip
      • plugins
      • recaptcha
      • reports
        • aging
          • invoices
        • custom
          • report
        • invoice
          • creation
        • tax
          • liability
        • transactions
          • applied
          • received
      • security
      • session
        • cart
      • settingscollection
      • upgrades
        • tasks
      • upload
      • vcard
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
      • widget
        • client
  • minPHP
    • components
      • input
      • record
    • helpers
      • color
      • data
        • structure
      • date
      • form
      • html
      • javascript
      • xml
    • lib
  • None
  • PHP

Classes

  • EventObject
  • Events

Class Events

Event Handler

Stores callbacks for particular events that may be executed when the event is triggered. Events are static, so each instance may register events triggered in this or other instances of the Event handler.

Package: blesta\components\events
Copyright: Copyright (c) 2010, Phillips Data, Inc.
License: The Blesta License Agreement
Link: Blesta
Located at components/events/events.php

Methods summary

public
# register( string $event_name, callable $callback, string $file_name = null )

Register a listener, to be notified when the event is triggered. Only permits one registered event per callback.

Register a listener, to be notified when the event is triggered. Only permits one registered event per callback.

Parameters

$event_name
string
$event_name The name of the event to register $callback under
$callback
callable
$callback The Class/Method or Object/Method or function to execute when the event is triggered.
$file_name
string
$file_name The full path to the file that contains the callback, null will default to looking in COMPONENTDIR/events/default/class_name.php (where class_name is the filecase format of the callback class [e.g. ClassName])
public
# unregister( string $event_name, callable $callback )

Unregisters a listener if the event has been registered. Will remove all copies of the registered event in the case that it was registered multiple times.

Unregisters a listener if the event has been registered. Will remove all copies of the registered event in the case that it was registered multiple times.

Parameters

$event_name
string
$event_name The name of the event to unregister $callback from
$callback
callable
$callback The Class/Method or Object/Method or function to unregister for the event
public EventObject
# trigger( EventObject $event )

Notifies all registered listeners of the event (called in the order they were set).

Notifies all registered listeners of the event (called in the order they were set).

Parameters

$event
EventObject
$event The event object to pass to the registered listeners

Returns

EventObject
The event processed
public EventObject
# triggerUntil( EventObject $event )

Notifies all registered listeners of the event (called in the order they were set), until one returns true, then ceases notifying all remaining listeners.

Notifies all registered listeners of the event (called in the order they were set), until one returns true, then ceases notifying all remaining listeners.

Parameters

$event
EventObject
$event The event object to pass to the registered listeners

Returns

EventObject
The event processed
public array
# getRegistered( string $event_name )

Returns all registered listeners for the given event name

Returns all registered listeners for the given event name

Parameters

$event_name
string
$event_name The name of the event to fetch registered callbacks for

Returns

array
An array of registered callbacks

Magic methods summary

Blesta API documentation generated by ApiGen 2.8.0