Small refactorings.
This commit is contained in:
parent
6d08164162
commit
4106002344
@ -410,12 +410,12 @@ abstract class AbstractQuery
|
|||||||
throw new NonUniqueResultException;
|
throw new NonUniqueResultException;
|
||||||
}
|
}
|
||||||
return array_shift($result);
|
return array_shift($result);
|
||||||
} else if (is_object($result)) {
|
}/* else if (is_object($result)) {
|
||||||
if (count($result) > 1) {
|
if (count($result) > 1) {
|
||||||
throw new NonUniqueResultException;
|
throw new NonUniqueResultException;
|
||||||
}
|
}
|
||||||
return $result->first();
|
return $result->first();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
@ -207,15 +207,12 @@ class ClassMetadataFactory
|
|||||||
$loaded = array();
|
$loaded = array();
|
||||||
|
|
||||||
// Collect parent classes, ignoring transient (not-mapped) classes.
|
// Collect parent classes, ignoring transient (not-mapped) classes.
|
||||||
//TODO: Evaluate whether we can use class_parents() here.
|
|
||||||
$parentClass = $name;
|
|
||||||
$parentClasses = array();
|
$parentClasses = array();
|
||||||
while ($parentClass = get_parent_class($parentClass)) {
|
foreach (array_reverse(class_parents($name)) as $parentClass) {
|
||||||
if ( ! $this->_driver->isTransient($parentClass)) {
|
if ( ! $this->_driver->isTransient($parentClass)) {
|
||||||
$parentClasses[] = $parentClass;
|
$parentClasses[] = $parentClass;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$parentClasses = array_reverse($parentClasses);
|
|
||||||
$parentClasses[] = $name;
|
$parentClasses[] = $name;
|
||||||
|
|
||||||
// Move down the hierarchy of parent classes, starting from the topmost class
|
// Move down the hierarchy of parent classes, starting from the topmost class
|
||||||
@ -262,8 +259,8 @@ class ClassMetadataFactory
|
|||||||
} else if ($parent->isIdGeneratorTable()) {
|
} else if ($parent->isIdGeneratorTable()) {
|
||||||
$class->getTableGeneratorDefinition($parent->tableGeneratorDefinition);
|
$class->getTableGeneratorDefinition($parent->tableGeneratorDefinition);
|
||||||
}
|
}
|
||||||
if ($generatorType = $parent->generatorType) {
|
if ($parent->generatorType) {
|
||||||
$class->setIdGeneratorType($generatorType);
|
$class->setIdGeneratorType($parent->generatorType);
|
||||||
}
|
}
|
||||||
if ($parent->idGenerator) {
|
if ($parent->idGenerator) {
|
||||||
$class->setIdGenerator($parent->idGenerator);
|
$class->setIdGenerator($parent->idGenerator);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user