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
be9d3599
Commit
be9d3599
authored
Apr 11, 2007
by
meus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed indentation and other issues related to coding style
parent
34cce3e0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
269 additions
and
272 deletions
+269
-272
Table.php
lib/Doctrine/Table.php
+242
-244
ColumnAggregationInheritanceTestCase.php
tests/ColumnAggregationInheritanceTestCase.php
+27
-28
No files found.
lib/Doctrine/Table.php
View file @
be9d3599
...
...
@@ -1170,28 +1170,26 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
*/
public
function
getClassnameToReturn
()
{
if
(
!
isset
(
$this
->
options
[
"subclasses"
]))
{
if
(
!
isset
(
$this
->
options
[
"subclasses"
]))
{
return
$this
->
options
[
'name'
];
}
foreach
(
$this
->
options
[
"subclasses"
]
as
$subclass
)
{
foreach
(
$this
->
options
[
"subclasses"
]
as
$subclass
)
{
$table
=
$this
->
conn
->
getTable
(
$subclass
);
$inheritanceMap
=
$table
->
getOption
(
"inheritanceMap"
);
$nomatch
=
false
;
foreach
(
$inheritanceMap
as
$key
=>
$value
)
{
if
(
!
isset
(
$this
->
data
[
$key
])
||
$this
->
data
[
$key
]
!=
$value
)
{
foreach
(
$inheritanceMap
as
$key
=>
$value
)
{
if
(
!
isset
(
$this
->
data
[
$key
])
||
$this
->
data
[
$key
]
!=
$value
)
{
$nomatch
=
true
;
break
;
}
}
if
(
!
$nomatch
)
{
if
(
!
$nomatch
)
{
return
$table
->
getComponentName
();
}
}
return
$this
->
options
[
'name'
];
}
/**
* @param $id database row id
* @throws Doctrine_Find_Exception
...
...
tests/ColumnAggregationInheritanceTestCase.php
View file @
be9d3599
...
...
@@ -40,7 +40,7 @@ class Doctrine_ColumnAggregationInheritance_TestCase extends Doctrine_UnitTestCa
parent
::
prepareData
();
//we create a test entity that is not a user and not a group
$entity
=
new
Entity
();
$entity
->
name
=
"Other Entity"
;
$entity
->
name
=
'Other Entity'
;
$entity
->
type
=
2
;
$entity
->
save
();
$this
->
otherEntity
=
$entity
;
...
...
@@ -49,19 +49,18 @@ class Doctrine_ColumnAggregationInheritance_TestCase extends Doctrine_UnitTestCa
public
function
testQueriedClassReturnedIfNoSubclassMatch
()
{
$q
=
new
Doctrine_Query
();
$entityOther
=
$q
->
from
(
"Entity"
)
->
where
(
"id=?"
)
->
execute
(
array
(
$this
->
otherEntity
->
id
))
->
getFirst
();
$entityOther
=
$q
->
from
(
'Entity'
)
->
where
(
'id=?'
)
->
execute
(
array
(
$this
->
otherEntity
->
id
))
->
getFirst
();
$this
->
assertTrue
(
$entityOther
instanceOf
Entity
);
}
public
function
testSubclassReturnedIfInheritanceMatches
()
{
$q
=
new
Doctrine_Query
();
$group
=
$q
->
from
(
"Entity"
)
->
where
(
"id=?"
)
->
execute
(
array
(
1
))
->
getFirst
();
$group
=
$q
->
from
(
'Entity'
)
->
where
(
'id=?'
)
->
execute
(
array
(
1
))
->
getFirst
();
$this
->
assertTrue
(
$group
instanceOf
Group
);
$q
=
new
Doctrine_Query
();
$user
=
$q
->
from
(
"Entity"
)
->
where
(
"id=?"
)
->
execute
(
array
(
5
))
->
getFirst
();
$user
=
$q
->
from
(
'Entity'
)
->
where
(
'id=?'
)
->
execute
(
array
(
5
))
->
getFirst
();
$this
->
assertTrue
(
$user
instanceOf
User
);
}
}
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