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
628aac0e
Commit
628aac0e
authored
Jun 25, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
9f8fbba4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
16 deletions
+40
-16
UnitOfWork.php
lib/Doctrine/Connection/UnitOfWork.php
+4
-4
Event.php
lib/Doctrine/Event.php
+36
-12
No files found.
lib/Doctrine/Connection/UnitOfWork.php
View file @
628aac0e
...
...
@@ -145,7 +145,7 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
$record
->
preSave
(
$event
);
if
(
!
$event
->
get
SkipOperation
(
))
{
if
(
!
$event
->
get
Option
(
'skipOperation'
))
{
switch
(
$record
->
state
())
{
case
Doctrine_Record
::
STATE_TDIRTY
:
$this
->
insert
(
$record
);
...
...
@@ -188,7 +188,7 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
$this
->
deleteComposites
(
$record
);
if
(
!
$event
->
get
SkipOperation
(
))
{
if
(
!
$event
->
get
Option
(
'skipOperation'
))
{
$this
->
conn
->
transaction
->
addDelete
(
$record
);
$record
->
state
(
Doctrine_Record
::
STATE_TCLEAN
);
...
...
@@ -340,7 +340,7 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
$record
->
preUpdate
(
$event
);
if
(
!
$event
->
get
SkipOperation
(
))
{
if
(
!
$event
->
get
Option
(
'skipOperation'
))
{
$array
=
$record
->
getPrepared
();
if
(
empty
(
$array
))
{
...
...
@@ -399,7 +399,7 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
$record
->
preInsert
(
$event
);
if
(
!
$event
->
get
SkipOperation
(
))
{
if
(
!
$event
->
get
Option
(
'skipOperation'
))
{
$array
=
$record
->
getPrepared
();
if
(
empty
(
$array
))
{
...
...
lib/Doctrine/Event.php
View file @
628aac0e
...
...
@@ -75,9 +75,9 @@ class Doctrine_Event
*/
protected
$_endedMicrotime
;
/**
* @var
boolean $skipOperation
* @var
array $_options an array of options
*/
protected
$_
skipOperation
=
false
;
protected
$_
options
=
array
()
;
/**
* constructor
*
...
...
@@ -138,28 +138,50 @@ class Doctrine_Event
return
$this
->
_code
;
}
/**
* setSkipOperation
* getOption
* returns the value of an option
*
* @return void
* @param string $option the name of the option
* @return mixed
*/
public
function
getOption
(
$option
)
{
if
(
!
isset
(
$this
->
_options
[
$option
]))
{
return
null
;
}
return
$this
->
_options
[
$option
];
}
/**
* skipOperation
* skips the next operation
* an alias for setOption('skipOperation', true)
*
* @return Doctrine_Event this object
*/
public
function
s
etSkipOperation
(
$bool
)
public
function
s
kipOperation
()
{
$this
->
_skipOperation
=
(
bool
)
$bool
;
return
$this
->
setOption
(
'skipOperation'
,
true
)
;
}
/**
* getSkipOperation
* setOption
* sets the value of an option
*
* @return void
* @param string $option the name of the option
* @param mixed $value the value of the given option
* @return Doctrine_Event this object
*/
public
function
getSkipOperation
(
)
public
function
setOption
(
$option
,
$value
)
{
return
$this
->
_skipOperation
;
$this
->
_options
[
$option
]
=
$value
;
return
$this
;
}
/**
* start
* starts the internal timer of this event
*
* @return
void
* @return
Doctrine_Event this object
*/
public
function
start
()
{
...
...
@@ -179,11 +201,13 @@ class Doctrine_Event
* end
* ends the internal timer of this event
*
* @return
void
* @return
Doctrine_Event this object
*/
public
function
end
()
{
$this
->
_endedMicrotime
=
microtime
(
true
);
return
$this
;
}
/**
* getInvoker
...
...
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