Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
b6642e2d
Commit
b6642e2d
authored
Sep 12, 2008
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved event stuff
parent
0ef216a9
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
51 additions
and
12 deletions
+51
-12
EventManager.php
lib/Doctrine/Common/EventManager.php
+3
-3
EventSubscriber.php
lib/Doctrine/Common/EventSubscriber.php
+39
-0
Event.php
lib/Doctrine/Common/Events/Event.php
+2
-2
Connection.php
lib/Doctrine/Connection.php
+1
-1
ConnectionFactory.php
lib/Doctrine/ConnectionFactory.php
+2
-2
EntityManager.php
lib/Doctrine/EntityManager.php
+1
-1
Doctrine_OrmTestSuite.php
tests/lib/Doctrine_OrmTestSuite.php
+1
-1
Doctrine_EntityManagerMock.php
tests/lib/mocks/Doctrine_EntityManagerMock.php
+2
-2
No files found.
lib/Doctrine/EventManager.php
→
lib/Doctrine/
Common/
EventManager.php
View file @
b6642e2d
...
...
@@ -19,7 +19,7 @@
* <http://www.phpdoctrine.org>.
*/
#namespace Doctrine::Common
::Event
;
#namespace Doctrine::Common;
/**
* The EventManager is the central point of Doctrine's event listener system.
...
...
@@ -30,7 +30,7 @@
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @since 2.0
*/
class
Doctrine_EventManager
class
Doctrine_
Common_
EventManager
{
/**
* Map of registered listeners.
...
...
@@ -107,7 +107,7 @@ class Doctrine_EventManager
*
* @param Doctrine::Common::Event::EventSubscriber $subscriber The subscriber.
*/
public
function
addEventSubscriber
(
Doctrine_EventSubscriber
$subscriber
)
public
function
addEventSubscriber
(
Doctrine_
Common_
EventSubscriber
$subscriber
)
{
$this
->
addEventListener
(
$subscriber
->
getSubscribedEvents
(),
$subscriber
);
}
...
...
lib/Doctrine/Common/EventSubscriber.php
0 → 100644
View file @
b6642e2d
<?php
/*
* $Id: EventListener.php 4653 2008-07-10 17:17:58Z romanb $
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
#namespace Doctrine::Common;
/**
* An EventSubscriber knows itself what events it is interested in.
* If an EventSubscriber is added to an EventManager, the manager invokes
* getSubscribedEvents() and registers the subscriber as a listener for all
* returned events.
*
* @author Roman Borschel <roman@code-factory.org>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 2.0
* @version $Revision: 4653 $
*/
interface
Doctrine_Common_EventSubscriber
{
public
function
getSubscribedEvents
();
}
lib/Doctrine/Event.php
→
lib/Doctrine/
Common/Events/
Event.php
View file @
b6642e2d
...
...
@@ -19,7 +19,7 @@
* <http://www.phpdoctrine.org>.
*/
#namespace Doctrine::
ORM
::Events;
#namespace Doctrine::
Common
::Events;
/**
* Doctrine_Event
...
...
@@ -32,7 +32,7 @@
* @since 2.0
* @version $Revision$
*/
class
Doctrine_Event
class
Doctrine_
Common_Events_
Event
{
/* Event callback constants */
const
preDelete
=
'preDelete'
;
...
...
lib/Doctrine/Connection.php
View file @
b6642e2d
...
...
@@ -175,7 +175,7 @@ class Doctrine_Connection
$this
->
_config
=
new
Doctrine_Configuration
();
}
if
(
!
$eventManager
)
{
$this
->
_eventManager
=
new
Doctrine_EventManager
();
$this
->
_eventManager
=
new
Doctrine_
Common_
EventManager
();
}
// create platform
...
...
lib/Doctrine/ConnectionFactory.php
View file @
b6642e2d
...
...
@@ -59,14 +59,14 @@ class Doctrine_ConnectionFactory
* @return Connection
*/
public
function
createConnection
(
array
$params
,
Doctrine_Configuration
$config
=
null
,
Doctrine_EventManager
$eventManager
=
null
)
Doctrine_
Common_
EventManager
$eventManager
=
null
)
{
// create default config and event manager, if not set
if
(
!
$config
)
{
$config
=
new
Doctrine_Configuration
();
}
if
(
!
$eventManager
)
{
$eventManager
=
new
Doctrine_EventManager
();
$eventManager
=
new
Doctrine_
Common_
EventManager
();
}
// check for existing pdo object
...
...
lib/Doctrine/EntityManager.php
View file @
b6642e2d
...
...
@@ -149,7 +149,7 @@ class Doctrine_EntityManager
* @param string $name
*/
protected
function
__construct
(
Doctrine_Connection
$conn
,
$name
,
Doctrine_Configuration
$config
,
Doctrine_EventManager
$eventManager
)
Doctrine_
Common_
EventManager
$eventManager
)
{
$this
->
_conn
=
$conn
;
$this
->
_name
=
$name
;
...
...
tests/lib/Doctrine_OrmTestSuite.php
View file @
b6642e2d
...
...
@@ -11,7 +11,7 @@ class Doctrine_OrmTestSuite extends Doctrine_TestSuite
protected
function
setUp
()
{
$config
=
new
Doctrine_Configuration
();
$eventManager
=
new
Doctrine_EventManager
();
$eventManager
=
new
Doctrine_
Common_
EventManager
();
$connectionOptions
=
array
(
'driverClass'
=>
'Doctrine_ConnectionMock'
,
'user'
=>
'john'
,
...
...
tests/lib/mocks/Doctrine_EntityManagerMock.php
View file @
b6642e2d
...
...
@@ -34,13 +34,13 @@ class Doctrine_EntityManagerMock extends Doctrine_EntityManager
* @return unknown
*/
public
static
function
create
(
$conn
,
$name
,
Doctrine_Configuration
$config
=
null
,
Doctrine_EventManager
$eventManager
=
null
)
Doctrine_
Common_
EventManager
$eventManager
=
null
)
{
if
(
is_null
(
$config
))
{
$config
=
new
Doctrine_Configuration
();
}
if
(
is_null
(
$eventManager
))
{
$eventManager
=
new
Doctrine_EventManager
();
$eventManager
=
new
Doctrine_
Common_
EventManager
();
}
return
new
Doctrine_EntityManagerMock
(
$conn
,
$name
,
$config
,
$eventManager
);
...
...
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