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
e2cb1585
Commit
e2cb1585
authored
Feb 01, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db eventlisteners updated
parent
5b594a54
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
62 deletions
+47
-62
Cache.php
lib/Doctrine/Db/Cache.php
+5
-39
EventListener.php
lib/Doctrine/Db/EventListener.php
+10
-0
Chain.php
lib/Doctrine/Db/EventListener/Chain.php
+25
-0
Interface.php
lib/Doctrine/Db/EventListener/Interface.php
+6
-0
Statement.php
lib/Doctrine/Db/Statement.php
+1
-23
No files found.
lib/Doctrine/Db/Cache.php
View file @
e2cb1585
...
...
@@ -18,6 +18,7 @@
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
*/
Doctrine
::
autoload
(
'Doctrine_Db_EventListener'
);
/**
* Doctrine_Db_Cache
*
...
...
@@ -32,48 +33,13 @@
*/
class
Doctrine_Db_Cache
extends
Doctrine_Db_EventListener
{
public
function
__construct
(
$cacheDriver
)
{
}
public
function
onPreQuery
(
Doctrine_Db_Event
$event
)
{
$query
=
$event
->
getQuery
();
$this
->
cache
->
process
(
$query
);
}
public
function
onQuery
(
Doctrine_Db_Event
$event
)
{
}
public
function
onPrePrepare
(
Doctrine_Db_Event
$event
)
{
}
public
function
onPrepare
(
Doctrine_Db_Event
$event
)
{
}
protected
$cache
;
public
function
onPreExec
(
Doctrine_Db_Event
$event
)
{
}
public
function
onExec
(
Doctrine_Db_Event
$event
)
{
public
function
__construct
(
Doctrine_Cache
$cache
)
{
$this
->
cache
=
$cache
;
}
public
function
onPreExecute
(
Doctrine_Db_Event
$event
)
{
$query
=
$event
->
getQuery
();
$this
->
cache
->
process
(
$query
);
}
public
function
onExecute
(
Doctrine_Db_Event
$event
)
{
}
}
lib/Doctrine/Db/EventListener.php
View file @
e2cb1585
...
...
@@ -55,6 +55,16 @@ class Doctrine_Db_EventListener implements Doctrine_Db_EventListener_Interface
{
}
public
function
onExec
(
Doctrine_Db_Event
$event
)
{
}
public
function
onPreFetch
(
Doctrine_Db_Event
$event
)
{
}
public
function
onFetch
(
Doctrine_Db_Event
$event
)
{
}
public
function
onPreFetchAll
(
Doctrine_Db_Event
$event
)
{
}
public
function
onFetchAll
(
Doctrine_Db_Event
$event
)
{
}
public
function
onPreRollBack
(
Doctrine_Db_Event
$event
)
{
}
...
...
lib/Doctrine/Db/EventListener/Chain.php
View file @
e2cb1585
...
...
@@ -130,6 +130,31 @@ class Doctrine_Db_EventListener_Chain extends Doctrine_Access implements Doctrin
$listener
->
onCommit
(
$event
);
}
}
public
function
onPreFetch
(
Doctrine_Db_Event
$event
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onPreFetch
(
$event
);
}
}
public
function
onFetch
(
Doctrine_Db_Event
$event
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onFetch
(
$event
);
}
}
public
function
onPreFetchAll
(
Doctrine_Db_Event
$event
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onPreFetchAll
(
$event
);
}
}
public
function
onFetchAll
(
Doctrine_Db_Event
$event
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onFetchAll
(
$event
);
}
}
public
function
onPreRollBack
(
Doctrine_Db_Event
$event
)
{
...
...
lib/Doctrine/Db/EventListener/Interface.php
View file @
e2cb1585
...
...
@@ -38,6 +38,12 @@ interface Doctrine_Db_EventListener_Interface {
public
function
onPreExec
(
Doctrine_Db_Event
$event
);
public
function
onExec
(
Doctrine_Db_Event
$event
);
public
function
onPreFetch
(
Doctrine_Db_Event
$event
);
public
function
onFetch
(
Doctrine_Db_Event
$event
);
public
function
onPreFetchAll
(
Doctrine_Db_Event
$event
);
public
function
onFetchAll
(
Doctrine_Db_Event
$event
);
public
function
onPreCommit
(
Doctrine_Db_Event
$event
);
public
function
onCommit
(
Doctrine_Db_Event
$event
);
...
...
lib/Doctrine/Db/Statement.php
View file @
e2cb1585
...
...
@@ -29,42 +29,20 @@
* @since 1.0
* @version $Revision$
*/
class
Doctrine_Db_Statement
extends
PDOStatement
class
Doctrine_Db_Statement
implements
Doctrine_Adapter_Statement_Interface
{
protected
$dbh
;
protected
$querySequence
;
protected
$baseSequence
;
protected
$executed
=
false
;
protected
function
__construct
(
$dbh
)
{
$this
->
dbh
=
$dbh
;
$this
->
baseSequence
=
$this
->
querySequence
=
$this
->
dbh
->
getQuerySequence
();
}
public
function
getQuerySequence
()
{
return
$this
->
querySequence
;
}
public
function
getBaseSequence
()
{
return
$this
->
baseSequence
;
}
public
function
getQuery
()
{
return
$this
->
queryString
;
}
public
function
isExecuted
(
$executed
=
null
)
{
if
(
$executed
===
null
)
return
$this
->
executed
;
$this
->
executed
=
(
bool
)
$executed
;
}
public
function
execute
(
array
$params
=
null
)
{
$event
=
new
Doctrine_Db_Event
(
$this
,
Doctrine_Db_Event
::
EXECUTE
,
$this
->
queryString
,
$params
);
...
...
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