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
8c54e8d7
Commit
8c54e8d7
authored
May 23, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed delete state handling
parent
01d8e55b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
Connection.php
lib/Doctrine/Connection.php
+2
-0
Record.php
lib/Doctrine/Record.php
+9
-8
No files found.
lib/Doctrine/Connection.php
View file @
8c54e8d7
...
...
@@ -1026,6 +1026,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
$record
->
getTable
()
->
getListener
()
->
onDelete
(
$record
);
$record
->
state
(
Doctrine_Record
::
STATE_TCLEAN
);
$this
->
commit
();
return
true
;
...
...
lib/Doctrine/Record.php
View file @
8c54e8d7
...
...
@@ -69,11 +69,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
* a Doctrine_Record turns into deleted state when it is deleted
*/
const
STATE_DELETED
=
6
;
/**
* the following protected variables use '_' prefixes, the reason for this is to allow child
* classes call for example $this->id, $this->state for getting the values of columns named 'id' and 'state'
* rather than the values of these protected variables
*/
/**
* @var object Doctrine_Table $_table the factory that created this data access object
*/
...
...
@@ -526,7 +521,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
}
$err
=
false
;
if
(
is_integer
(
$state
))
{
if
(
$state
>=
1
&&
$state
<=
6
)
{
$this
->
_state
=
$state
;
}
else
{
...
...
@@ -548,8 +542,15 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
}
}
if
(
$err
)
if
(
$this
->
_state
===
Doctrine_Record
::
STATE_TCLEAN
||
$this
->
_state
===
Doctrine_Record
::
STATE_CLEAN
)
{
$this
->
_modified
=
array
();
}
if
(
$err
)
{
throw
new
Doctrine_Record_State_Exception
(
'Unknown record state '
.
$state
);
}
}
/**
* refresh
...
...
@@ -779,7 +780,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
if
(
$value
===
null
)
{
$value
=
self
::
$_null
;
}
$this
->
_data
[
$lower
]
=
$value
;
$this
->
_modified
[]
=
$lower
;
switch
(
$this
->
_state
)
{
...
...
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