Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F3281659
PhutilEventListener.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
855 B
Referenced Files
None
Subscribers
None
PhutilEventListener.php
View Options
<?php
abstract
class
PhutilEventListener
extends
Phobject
{
private
$listenerID
;
private
static
$nextListenerID
=
1
;
final
public
function
__construct
(
)
{
// <empty>
}
abstract
public
function
register
(
)
;
abstract
public
function
handleEvent
(
PhutilEvent
$event
)
;
final
public
function
listen
(
$type
)
{
$engine
=
PhutilEventEngine
::
getInstance
(
)
;
$engine
->
addListener
(
$this
,
$type
)
;
}
/**
* Return a scalar ID unique to this listener. This is used to deduplicate
* listeners which match events on multiple rules, so they are invoked only
* once.
*
* @return int A scalar unique to this object instance.
*/
final
public
function
getListenerID
(
)
{
if
(
!
$this
->
listenerID
)
{
$this
->
listenerID
=
self
::
$nextListenerID
;
self
::
$nextListenerID
++
;
}
return
$this
->
listenerID
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Mar 24, 00:32 (1 d, 4 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1114713
Default Alt Text
PhutilEventListener.php (855 B)
Attached To
Mode
rARC Arcanist
Attached
Detach File
Event Timeline
Log In to Comment