MIOLO20
Toggle main menu visibility
Página principal
Estruturas de dados
Estruturas de dados
Hierarquia de classes
Campos de dados
Tudo
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Funções
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Variáveis
$
a
b
c
d
e
f
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Ficheiros
Lista de ficheiros
Globais
Tudo
$
_
a
c
d
e
f
g
i
l
m
o
p
r
s
u
Funções
Variáveis
$
_
c
e
f
l
m
o
p
s
Exemplos
▼
MIOLO20
►
Estruturas de dados
▼
Ficheiros
▼
Lista de ficheiros
▼
classes
►
contrib
►
database
►
doc
▼
extensions
▼
doctrine-dbal
▼
Doctrine
▼
Common
►
Annotations
►
Cache
►
Collections
►
Util
►
ClassLoader.php
►
CommonException.php
►
EventArgs.php
►
EventManager.php
►
EventSubscriber.php
►
Lexer.php
►
NotifyPropertyChanged.php
►
PropertyChangedListener.php
►
Version.php
►
DBAL
►
Symfony
►
jasper
►
spaw
►
class.phpmailer.php
►
class.smtp.php
►
cpaint.inc.php
►
cpaint_proxy.php
►
ezpdf
►
flow
►
interfaces
►
model
►
persistence
►
pslib
►
security
►
services
►
tests
►
ui
►
utils
►
compatibility.class
►
miolo.class
►
Globais
►
Exemplos
•
Tudo
Estruturas de dados
Namespaces
Ficheiros
Funções
Variáveis
Carregando...
Procurando...
Nenhuma entrada encontrada
EventManager.php
Ir para a documentação deste ficheiro.
1
<?php
2
/*
3
* $Id$
4
*
5
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16
*
17
* This software consists of voluntary contributions made by many individuals
18
* and is licensed under the LGPL. For more information, see
19
* <http://www.doctrine-project.org>.
20
*/
21
22
namespace
Doctrine\Common
;
23
24
use Doctrine\Common\Events\Event;
25
39
class
EventManager
40
{
47
private
$_listeners = array();
48
58
public
function
dispatchEvent
($eventName,
EventArgs
$eventArgs =
null
)
59
{
60
if
(isset($this->_listeners[$eventName])) {
61
$eventArgs = $eventArgs ===
null
?
EventArgs::getEmptyInstance
() : $eventArgs;
62
63
foreach
($this->_listeners[$eventName] as $listener) {
64
$listener->$eventName($eventArgs);
65
}
66
}
67
}
58
public
function
dispatchEvent
($eventName,
EventArgs
$eventArgs =
null
) {
…
}
68
75
public
function
getListeners
($event =
null
)
76
{
77
return
$event ? $this->_listeners[$event] : $this->_listeners;
78
}
75
public
function
getListeners
($event =
null
) {
…
}
79
86
public
function
hasListeners
($event)
87
{
88
return
isset($this->_listeners[$event]) && $this->_listeners[$event];
89
}
86
public
function
hasListeners
($event) {
…
}
90
97
public
function
addEventListener
($events, $listener)
98
{
99
// Picks the hash code related to that listener
100
$hash = spl_object_hash($listener);
101
102
foreach
((array) $events as $event) {
103
// Overrides listener if a previous one was associated already
104
// Prevents duplicate listeners on same event (same instance only)
105
$this->_listeners[$event][$hash] = $listener;
106
}
107
}
97
public
function
addEventListener
($events, $listener) {
…
}
108
115
public
function
removeEventListener
($events, $listener)
116
{
117
// Picks the hash code related to that listener
118
$hash = spl_object_hash($listener);
119
120
foreach
((array) $events as $event) {
121
// Check if actually have this listener associated
122
if
(isset($this->_listeners[$event][$hash])) {
123
unset($this->_listeners[$event][$hash]);
124
}
125
}
126
}
115
public
function
removeEventListener
($events, $listener) {
…
}
127
134
public
function
addEventSubscriber
(
EventSubscriber
$subscriber)
135
{
136
$this->
addEventListener
($subscriber->
getSubscribedEvents
(), $subscriber);
137
}
134
public
function
addEventSubscriber
(
EventSubscriber
$subscriber) {
…
}
138
}
39
class
EventManager
{
…
};
Doctrine\Common\EventArgs
Definição
EventArgs.php:40
Doctrine\Common\EventArgs\getEmptyInstance
static getEmptyInstance()
Definição
EventArgs.php:61
Doctrine\Common\EventManager
Definição
EventManager.php:40
Doctrine\Common\EventManager\getListeners
getListeners($event=null)
Definição
EventManager.php:75
Doctrine\Common\EventManager\dispatchEvent
dispatchEvent($eventName, EventArgs $eventArgs=null)
Definição
EventManager.php:58
Doctrine\Common\EventManager\hasListeners
hasListeners($event)
Definição
EventManager.php:86
Doctrine\Common\EventManager\addEventSubscriber
addEventSubscriber(EventSubscriber $subscriber)
Definição
EventManager.php:134
Doctrine\Common\EventManager\removeEventListener
removeEventListener($events, $listener)
Definição
EventManager.php:115
Doctrine\Common\EventManager\addEventListener
addEventListener($events, $listener)
Definição
EventManager.php:97
Doctrine\Common\EventSubscriber
Definição
EventSubscriber.php:38
Doctrine\Common\EventSubscriber\getSubscribedEvents
getSubscribedEvents()
Doctrine\Common
classes
extensions
doctrine-dbal
Doctrine
Common
EventManager.php
Gerado por
1.10.0