Overview

Packages

  • Auth
    • Ads
    • Ldap
    • Xoops
  • Autotasks
  • Config
    • Category
    • Item
    • Option
  • Core
    • Filesystem
    • Filters
    • Logger
    • Mail
    • Message
    • Password
    • Security
    • StopSpammer
    • Template
    • Textsanitizer
    • VersionChecker
  • Data
    • Avatar
    • Comment
  • Database
    • Connection
    • Criteria
    • Legacy
    • MySQL
    • PDO
    • Updater
  • Feeds
    • RSS
  • File
  • Form
    • Base
    • Elements
  • ICMS
    • IPF
      • View
  • Image
    • Category
  • Ipf
    • Category
    • Controller
    • Export
    • form
    • Keyhighlighter
    • Member
    • Object
    • Permission
    • richfile
    • Tree
    • urllink
    • View
  • kernel
    • Set
  • Member
    • Group
    • GroupMembership
    • GroupPermission
    • User
  • Messaging
  • Module
  • None
  • Notification
  • Page
  • Plugins
    • Editor
  • Preload
    • Libraries
  • Privmessage
  • Session
  • SmartObject
  • View
    • Block
    • Breadcrumb
    • PageNav
    • PrinterFriendly
    • Template
    • Templates
    • Theme
    • Tree

Classes

  • icms_Autoloader
  • icms_Event
  • icms_Utils
  • Overview
  • Package
  • Class

Class icms_Event

icms_Event class definition

Category: ICMS
Copyright: The ImpressCMS Project http://www.impresscms.org
License: GNU General Public License (GPL)
Version: SVN: $Id$
Located at Event.php
Methods summary
public static icms_Event
# current( integer $index = 0 )

Returns information about a fired event.

Returns information about a fired event.

Parameters

$index
0 for current, 1 for parent (if current event due to another event), and so on...

Returns

icms_Event
public static
# attach( string $namespace, string $name, mixed $callback )

Registers an event handler

Registers an event handler

icms_Event::attach( 'icms_db_IConnection', 'connect', 'something' ); => will call something( $eventParams, $event ) when the event is fired icms_Event::attach( 'icms_db_IConnection', 'connect', array( $object, 'something' ) ); => will call $object->something( $eventParams, $event ) when the event is fired icms_Event::attach( 'icms_db_IConnection', '*', array( 'MyClass', 'something' ) ); => will call MyClass::something( $eventParams, $event ) when any event that belongs to the 'icms_db_IConnection' namespace is fired Also, on PHP 5.3+, you can use closures: icms_Event::attach( 'icms_db_IConnection', 'execute', function ( $params, $event ) { echo 'Executing: ' . $params['sql']; } );

Parameters

$namespace
Event namespace
$name
Event name (use * to attach to all signals of $namespace)
$callback
public static
# detach( string $namespace, string $name, mixed $callback )

Detach the specified event handler.

Detach the specified event handler.

Parameters

$namespace
$name
$callback
public static icms_Event
# trigger( string $namespace, string $name, object $source, array $parameters = array() )

Triggers an event.

Triggers an event.

Parameters

$namespace
Event namespace
$name
Event name (use * to attach to all events of $namespace)
$source
Object that triggered this event
$parameters
Event parameters

Returns

icms_Event
public
# __construct( $namespace, $name, $source, $params = array(), $canCancel = false )
Properties summary
protected static array $handlers

Registered event handlers

Registered event handlers

# array()
protected static array $events

Events currently being processed

Events currently being processed

# array()
public string $namespace

Namespace this event belongs to.

Namespace this event belongs to.

Readonly

# ""
public string $name

Name of this event

Name of this event

Readonly

# ""
public object $source

Object that fired this event.

Object that fired this event.

Readonly

#
public array() $parameters

Parameters

Parameters

Readonly

# array()
public boolean $canCancel

Whether this event can be canceled or not.

Whether this event can be canceled or not.

Readonly

# false
public boolean $canceled

Whether this event has been canceled or not.

Whether this event has been canceled or not.

# false
API documentation generated by ApiGen