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
b994c1a6
Commit
b994c1a6
authored
Dec 28, 2007
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed #697.
parent
260b9ae2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
5 deletions
+68
-5
UnitOfWork.php
lib/Doctrine/Connection/UnitOfWork.php
+2
-0
Record.php
lib/Doctrine/Record.php
+12
-5
697TestCase.php
tests/Ticket/697TestCase.php
+53
-0
run.php
tests/run.php
+1
-0
No files found.
lib/Doctrine/Connection/UnitOfWork.php
View file @
b994c1a6
...
@@ -611,6 +611,8 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
...
@@ -611,6 +611,8 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
$rootRecord
->
merge
(
$dataSet
[
$parent
]);
$rootRecord
->
merge
(
$dataSet
[
$parent
]);
$this
->
processSingleInsert
(
$rootRecord
);
$this
->
processSingleInsert
(
$rootRecord
);
$record
->
assignIdentifier
(
$rootRecord
->
identifier
());
}
else
{
}
else
{
foreach
((
array
)
$rootRecord
->
identifier
()
as
$id
=>
$value
)
{
foreach
((
array
)
$rootRecord
->
identifier
()
as
$id
=>
$value
)
{
$dataSet
[
$parent
][
$id
]
=
$value
;
$dataSet
[
$parent
][
$id
]
=
$value
;
...
...
lib/Doctrine/Record.php
View file @
b994c1a6
...
@@ -1443,11 +1443,18 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
...
@@ -1443,11 +1443,18 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
$this
->
_state
=
Doctrine_Record
::
STATE_CLEAN
;
$this
->
_state
=
Doctrine_Record
::
STATE_CLEAN
;
$this
->
_modified
=
array
();
$this
->
_modified
=
array
();
}
else
{
}
else
{
$name
=
$this
->
_table
->
getIdentifier
();
if
(
is_array
(
$id
))
{
$this
->
_id
[
$name
]
=
$id
;
foreach
(
$id
as
$fieldName
=>
$value
)
{
$this
->
_data
[
$name
]
=
$id
;
$this
->
_id
[
$fieldName
]
=
$value
;
$this
->
_state
=
Doctrine_Record
::
STATE_CLEAN
;
$this
->
_data
[
$fieldName
]
=
$value
;
$this
->
_modified
=
array
();
}
}
else
{
$name
=
$this
->
_table
->
getIdentifier
();
$this
->
_id
[
$name
]
=
$id
;
$this
->
_data
[
$name
]
=
$id
;
}
$this
->
_state
=
Doctrine_Record
::
STATE_CLEAN
;
$this
->
_modified
=
array
();
}
}
}
}
...
...
tests/Ticket/697TestCase.php
0 → 100644
View file @
b994c1a6
<?php
/**
* Doctrine_Ticket_697_TestCase
*
* @package Doctrine
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @category Object Relational Mapping
* @link www.phpdoctrine.com
* @since 1.0
* @version $Revision$
*/
class
Doctrine_Ticket_697_TestCase
extends
Doctrine_UnitTestCase
{
public
function
prepareData
()
{
}
public
function
prepareTables
()
{
$this
->
tables
=
array
(
'T697_Person'
,
'T697_User'
);
parent
::
prepareTables
();
}
public
function
testIdsAreSetWhenSavingSubclassInstancesInCTI
()
{
$p
=
new
T697_Person
();
$p
[
'name'
]
=
'Rodrigo'
;
$p
->
save
();
$this
->
assertEqual
(
1
,
$p
->
id
);
$u
=
new
T697_User
();
$u
[
'name'
]
=
'Fernandes'
;
$u
[
'password'
]
=
'Doctrine RULES'
;
$u
->
save
();
$this
->
assertEqual
(
2
,
$u
->
id
);
}
}
class
T697_Person
extends
Doctrine_Record
{
public
function
setTableDefinition
()
{
$this
->
hasColumn
(
'name'
,
'string'
,
30
);
}
}
//Class table inheritance
class
T697_User
extends
T697_Person
{
public
function
setTableDefinition
()
{
$this
->
hasColumn
(
'password'
,
'string'
,
30
);
}
}
tests/run.php
View file @
b994c1a6
...
@@ -25,6 +25,7 @@ $tickets->addTestCase(new Doctrine_Ticket_438_TestCase());
...
@@ -25,6 +25,7 @@ $tickets->addTestCase(new Doctrine_Ticket_438_TestCase());
$tickets
->
addTestCase
(
new
Doctrine_Ticket_638_TestCase
());
$tickets
->
addTestCase
(
new
Doctrine_Ticket_638_TestCase
());
$tickets
->
addTestCase
(
new
Doctrine_Ticket_673_TestCase
());
$tickets
->
addTestCase
(
new
Doctrine_Ticket_673_TestCase
());
$tickets
->
addTestCase
(
new
Doctrine_Ticket_626D_TestCase
());
$tickets
->
addTestCase
(
new
Doctrine_Ticket_626D_TestCase
());
$tickets
->
addTestCase
(
new
Doctrine_Ticket_697_TestCase
());
$test
->
addTestCase
(
$tickets
);
$test
->
addTestCase
(
$tickets
);
// Connection drivers (not yet fully tested)
// Connection drivers (not yet fully tested)
...
...
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