Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
solarium
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
solarium
Commits
170fb52f
Commit
170fb52f
authored
Nov 10, 2014
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure an eventhandler instance is always available
parent
ac46a00b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
25 deletions
+24
-25
library/Solarium/Core/Client/Client.php
library/Solarium/Core/Client/Client.php
+24
-25
No files found.
library/Solarium/Core/Client/Client.php
View file @
170fb52f
...
@@ -220,6 +220,9 @@ class Client extends Configurable
...
@@ -220,6 +220,9 @@ class Client extends Configurable
*/
*/
protected
function
init
()
protected
function
init
()
{
{
//@todo use injection
$this
->
eventDispatcher
=
new
EventDispatcher
();
foreach
(
$this
->
options
as
$name
=>
$value
)
{
foreach
(
$this
->
options
as
$name
=>
$value
)
{
switch
(
$name
)
{
switch
(
$name
)
{
case
'endpoint'
:
case
'endpoint'
:
...
@@ -561,33 +564,29 @@ class Client extends Configurable
...
@@ -561,33 +564,29 @@ class Client extends Configurable
return
$this
->
queryTypes
;
return
$this
->
queryTypes
;
}
}
/**
/**
* Gets the event dispatcher.
* Gets the event dispatcher.
*
*
* @return EventDispatcherInterface
* @return EventDispatcherInterface
*/
*/
public
function
getEventDispatcher
()
public
function
getEventDispatcher
()
{
{
if
(
!
$this
->
eventDispatcher
)
{
return
$this
->
eventDispatcher
;
$this
->
eventDispatcher
=
new
EventDispatcher
();
}
}
return
$this
->
eventDispatcher
;
/**
}
* Sets the event dispatcher.
*
/**
* @param EventDispatcherInterface $eventDispatcher
* Sets the event dispatcher.
*
*
* @return $this
* @param EventDispatcherInterface $eventDispatcher
*/
*
public
function
setEventDispatcher
(
EventDispatcherInterface
$eventDispatcher
)
* @return $this
{
*/
$this
->
eventDispatcher
=
$eventDispatcher
;
public
function
setEventDispatcher
(
EventDispatcherInterface
$eventDispatcher
)
{
return
$this
;
$this
->
eventDispatcher
=
$eventDispatcher
;
}
return
$this
;
}
/**
/**
* Register a plugin
* Register a plugin
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment