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
41060023
Commit
41060023
authored
Apr 14, 2010
by
Roman S. Borschel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small refactorings.
parent
6d081641
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
15 deletions
+12
-15
AbstractQuery.php
lib/Doctrine/ORM/AbstractQuery.php
+2
-2
ClassMetadataFactory.php
lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php
+10
-13
No files found.
lib/Doctrine/ORM/AbstractQuery.php
View file @
41060023
...
...
@@ -410,12 +410,12 @@ abstract class AbstractQuery
throw
new
NonUniqueResultException
;
}
return
array_shift
(
$result
);
}
else
if
(
is_object
(
$result
))
{
}
/*
else if (is_object($result)) {
if (count($result) > 1) {
throw new NonUniqueResultException;
}
return $result->first();
}
}
*/
return
$result
;
}
...
...
lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php
View file @
41060023
...
...
@@ -203,19 +203,16 @@ class ClassMetadataFactory
if
(
!
$this
->
_initialized
)
{
$this
->
_initialize
();
}
$loaded
=
array
();
// Collect parent classes, ignoring transient (not-mapped) classes.
//TODO: Evaluate whether we can use class_parents() here.
$parentClass
=
$name
;
$parentClasses
=
array
();
while
(
$parentClass
=
get_parent_class
(
$parentClass
)
)
{
foreach
(
array_reverse
(
class_parents
(
$name
))
as
$parentClass
)
{
if
(
!
$this
->
_driver
->
isTransient
(
$parentClass
))
{
$parentClasses
[]
=
$parentClass
;
}
}
$parentClasses
=
array_reverse
(
$parentClasses
);
$parentClasses
[]
=
$name
;
// Move down the hierarchy of parent classes, starting from the topmost class
...
...
@@ -231,7 +228,7 @@ class ClassMetadataFactory
}
$class
=
$this
->
_newClassMetadataInstance
(
$className
);
if
(
$parent
)
{
$class
->
setInheritanceType
(
$parent
->
inheritanceType
);
$class
->
setDiscriminatorColumn
(
$parent
->
discriminatorColumn
);
...
...
@@ -262,8 +259,8 @@ class ClassMetadataFactory
}
else
if
(
$parent
->
isIdGeneratorTable
())
{
$class
->
getTableGeneratorDefinition
(
$parent
->
tableGeneratorDefinition
);
}
if
(
$
generatorType
=
$
parent
->
generatorType
)
{
$class
->
setIdGeneratorType
(
$generatorType
);
if
(
$parent
->
generatorType
)
{
$class
->
setIdGeneratorType
(
$
parent
->
generatorType
);
}
if
(
$parent
->
idGenerator
)
{
$class
->
setIdGenerator
(
$parent
->
idGenerator
);
...
...
@@ -282,18 +279,18 @@ class ClassMetadataFactory
$eventArgs
=
new
\Doctrine\ORM\Event\LoadClassMetadataEventArgs
(
$class
);
$this
->
_evm
->
dispatchEvent
(
Events
::
loadClassMetadata
,
$eventArgs
);
}
$this
->
_loadedMetadata
[
$className
]
=
$class
;
$parent
=
$class
;
if
(
!
$class
->
isMappedSuperclass
)
{
array_unshift
(
$visited
,
$className
);
}
$loaded
[]
=
$className
;
}
return
$loaded
;
}
...
...
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