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
3a282b1e
Commit
3a282b1e
authored
Nov 13, 2009
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0][DDC-141] Fixed.
parent
fa99b944
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
6 deletions
+23
-6
SqlWalker.php
lib/Doctrine/ORM/Query/SqlWalker.php
+1
-3
SingleTableInheritanceTest.php
...trine/Tests/ORM/Functional/SingleTableInheritanceTest.php
+22
-3
No files found.
lib/Doctrine/ORM/Query/SqlWalker.php
View file @
3a282b1e
...
...
@@ -1115,9 +1115,7 @@ class SqlWalker implements TreeWalker
$discrSql
=
$this
->
_generateDiscriminatorColumnConditionSql
(
$this
->
_currentRootAlias
);
if
(
$discrSql
)
{
if
(
$termsSql
)
$sql
.=
' AND'
;
$sql
.=
' '
.
$discrSql
;
$sql
.=
' AND '
.
$discrSql
;
}
return
$sql
;
...
...
tests/Doctrine/Tests/ORM/Functional/SingleTableInheritanceTest.php
View file @
3a282b1e
...
...
@@ -22,8 +22,6 @@ class SingleTableInheritanceTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this
->
_em
->
getClassMetadata
(
'Doctrine\Tests\ORM\Functional\RelatedEntity'
)
));
}
catch
(
\Exception
$e
)
{
var_dump
(
$e
->
getMessage
());
var_dump
(
$e
->
getTraceAsString
());
// Swallow all exceptions. We do not test the schema tool here.
}
}
...
...
@@ -94,7 +92,28 @@ class SingleTableInheritanceTest extends \Doctrine\Tests\OrmFunctionalTestCase
$query
=
$this
->
_em
->
createQuery
(
"delete Doctrine\Tests\ORM\Functional\ParentEntity e"
);
$affected
=
$query
->
execute
();
$this
->
assertEquals
(
2
,
$affected
);
$this
->
assertEquals
(
2
,
$affected
);
$this
->
_em
->
clear
();
// DQL query with WHERE clause
$child
=
new
ChildEntity
;
$child
->
setData
(
'thedata'
);
$child
->
setNumber
(
1234
);
$this
->
_em
->
persist
(
$child
);
$this
->
_em
->
flush
();
$this
->
_em
->
clear
();
$query
=
$this
->
_em
->
createQuery
(
'select e from Doctrine\Tests\ORM\Functional\ParentEntity e where e.id=?1'
);
$query
->
setParameter
(
1
,
$child
->
getId
());
$child2
=
$query
->
getSingleResult
();
$this
->
assertTrue
(
$child2
instanceof
ChildEntity
);
$this
->
assertEquals
(
'thedata'
,
$child2
->
getData
());
$this
->
assertEquals
(
1234
,
$child2
->
getNumber
());
$this
->
assertEquals
(
$child
->
getId
(),
$child2
->
getId
());
$this
->
assertFalse
(
$child
===
$child2
);
}
}
...
...
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