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
cfa6a512
Commit
cfa6a512
authored
Aug 25, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed ticket #26
parent
d283fbf1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
4 deletions
+31
-4
Record.php
Doctrine/Record.php
+15
-2
RecordTestCase.php
tests/RecordTestCase.php
+16
-2
No files found.
Doctrine/Record.php
View file @
cfa6a512
...
@@ -586,6 +586,9 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
...
@@ -586,6 +586,9 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
* @param mixed $value
* @param mixed $value
*/
*/
final
public
function
internalSet
(
$name
,
$value
)
{
final
public
function
internalSet
(
$name
,
$value
)
{
if
(
$value
===
null
)
$value
=
self
::
$null
;
$this
->
data
[
$name
]
=
$value
;
$this
->
data
[
$name
]
=
$value
;
}
}
/**
/**
...
@@ -618,6 +621,9 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
...
@@ -618,6 +621,9 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
if
(
$this
->
state
==
Doctrine_Record
::
STATE_TCLEAN
)
if
(
$this
->
state
==
Doctrine_Record
::
STATE_TCLEAN
)
$this
->
state
=
Doctrine_Record
::
STATE_TDIRTY
;
$this
->
state
=
Doctrine_Record
::
STATE_TDIRTY
;
if
(
$value
===
null
)
$value
=
self
::
$null
;
$this
->
data
[
$name
]
=
$value
;
$this
->
data
[
$name
]
=
$value
;
$this
->
modified
[]
=
$name
;
$this
->
modified
[]
=
$name
;
}
}
...
@@ -646,6 +652,9 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
...
@@ -646,6 +652,9 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
$old
=
$this
->
get
(
$name
);
$old
=
$this
->
get
(
$name
);
if
(
$old
!==
$value
)
{
if
(
$old
!==
$value
)
{
if
(
$value
===
null
)
$value
=
self
::
$null
;
$this
->
data
[
$name
]
=
$value
;
$this
->
data
[
$name
]
=
$value
;
$this
->
modified
[]
=
$name
;
$this
->
modified
[]
=
$name
;
switch
(
$this
->
state
)
:
switch
(
$this
->
state
)
:
...
@@ -797,7 +806,11 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
...
@@ -797,7 +806,11 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
$this
->
data
[
$v
]
=
$this
->
data
[
$v
]
->
getIncremented
();
$this
->
data
[
$v
]
=
$this
->
data
[
$v
]
->
getIncremented
();
}
}
if
(
$this
->
data
[
$v
]
===
self
::
$null
)
$a
[
$v
]
=
null
;
else
$a
[
$v
]
=
$this
->
data
[
$v
];
$a
[
$v
]
=
$this
->
data
[
$v
];
}
}
foreach
(
$this
->
table
->
getInheritanceMap
()
as
$k
=>
$v
)
{
foreach
(
$this
->
table
->
getInheritanceMap
()
as
$k
=>
$v
)
{
...
...
tests/RecordTestCase.php
View file @
cfa6a512
...
@@ -93,7 +93,21 @@ class Doctrine_RecordTestCase extends Doctrine_UnitTestCase {
...
@@ -93,7 +93,21 @@ class Doctrine_RecordTestCase extends Doctrine_UnitTestCase {
$this
->
assertEqual
(
$coll
->
count
(),
1
);
$this
->
assertEqual
(
$coll
->
count
(),
1
);
}
}
public
function
testUpdatingWithNullValue
()
{
$user
=
$this
->
connection
->
getTable
(
'User'
)
->
find
(
5
);
$user
->
name
=
null
;
$this
->
assertEqual
(
$user
->
name
,
null
);
$user
->
save
();
$this
->
assertEqual
(
$user
->
name
,
null
);
$this
->
connection
->
clear
();
$user
=
$this
->
connection
->
getTable
(
'User'
)
->
find
(
5
);
$this
->
assertEqual
(
$user
->
name
,
null
);
}
public
function
testDateTimeType
()
{
public
function
testDateTimeType
()
{
$date
=
new
DateTest
();
$date
=
new
DateTest
();
...
...
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