CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (GitHub)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • Slack
    • Paid Support
CakePHP

C CakePHP 2.6 API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 2.6
      • 4.2
      • 4.1
      • 4.0
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Packages

  • Cake
    • Cache
      • Engine
    • Configure
    • Console
      • Command
        • Task
    • Controller
      • Component
        • Acl
        • Auth
    • Core
    • Error
    • Event
    • I18n
    • Log
      • Engine
    • Model
      • Behavior
      • Datasource
        • Database
        • Session
      • Validator
    • Network
      • Email
      • Http
    • Routing
      • Filter
      • Route
    • TestSuite
      • Coverage
      • Fixture
      • Reporter
    • Utility
    • View
      • Helper

Classes

  • CakeEvent
  • CakeEventManager

Interfaces

  • CakeEventListener

Class CakeEvent

Represents the transport class of events across the system. It receives a name, subject and an optional payload. The name can be any string that uniquely identifies the event across the application, while the subject represents the object that the event applies to.

Package: Cake\Event
Copyright: Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
License: MIT License
Location: Cake/Event/CakeEvent.php

Properties summary

  • $_name protected
    string
    Name of the event
  • $_stopped protected
    boolean
    Flags an event as stopped or not, default is false
  • $_subject protected
    object
    The object this event applies to (usually the same object that generates the event)
  • $data public
    mixed
    Custom data for the method that receives the event
  • $result public
    mixed
    Property used to retain the result value of the event listeners

Method Summary

  • __construct() public
    Constructor
  • __get() public
    Dynamically returns the name and subject if accessed directly
  • isStopped() public
    Check if the event is stopped
  • name() public
    Returns the name of this event. This is usually used as the event identifier
  • stopPropagation() public
    Stops the event from being used anymore
  • subject() public
    Returns the subject of this event

Method Detail

__construct() public ¶

__construct( string $name , object $subject = null , mixed $data = null )

Constructor

Parameters
string $name
Name of the event
object $subject optional null
the object that this event applies to (usually the object that is generating the event)
mixed $data optional null

any value you wish to be transported with this event to it can be read by listeners

Examples of usage:

$event = new CakeEvent('Order.afterBuy', $this, array('buyer' => $userData));
$event = new CakeEvent('User.afterRegister', $UserModel);

__get() public ¶

__get( string $attribute )

Dynamically returns the name and subject if accessed directly

Parameters
string $attribute
Attribute name.
Returns
mixed

isStopped() public ¶

isStopped( )

Check if the event is stopped

Returns
boolean
True if the event is stopped

name() public ¶

name( )

Returns the name of this event. This is usually used as the event identifier

Returns
string

stopPropagation() public ¶

stopPropagation( )

Stops the event from being used anymore

subject() public ¶

subject( )

Returns the subject of this event

Returns
string

Properties detail

$_name ¶

protected string

Name of the event

null

$_stopped ¶

protected boolean

Flags an event as stopped or not, default is false

false

$_subject ¶

protected object

The object this event applies to (usually the same object that generates the event)

$data ¶

public mixed

Custom data for the method that receives the event

null

$result ¶

public mixed

Property used to retain the result value of the event listeners

null
OpenHub
Rackspace
Rackspace
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (GitHub)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • Slack
  • Paid Support

Generated using CakePHP API Docs