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.
Copyright: Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
License: MIT License
Located at Cake/Event/CakeEvent.php
Method Detail
__constructsource 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: <code> $event = new CakeEvent('Order.afterBuy', $this, array('buyer' => $userData)); $event = new CakeEvent('User.afterRegister', $UserModel); </code>
__getsource public
__get( string $attribute )
Dynamically returns the name and subject if accessed directly
Parameters
- string
$attribute
- Attribute name.
Returns
mixed
mixed
isStoppedsource public
isStopped( )
Check if the event is stopped
Returns
boolean
True if the event is stopped
namesource public
name( )
Returns the name of this event. This is usually used as the event identifier
Returns
string
string
Properties summary
© 2005–2016 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
http://api.cakephp.org/2.7/class-CakeEvent.html