1
0
mirror of synced 2025-01-18 22:41:43 +03:00

drop useless support for associations

This commit is contained in:
Fabio B. Silva 2013-06-12 10:29:17 -04:00 committed by fabios
parent d961028b14
commit c1e688fc81

View File

@ -146,8 +146,8 @@ class SimpleObjectHydrator extends AbstractHydrator
{
if (isset($this->_rsm->fieldMappings[$column])) {
$name = $this->_rsm->fieldMappings[$column];
$class = isset($this->declaringClasses[$column])
$name = $this->_rsm->fieldMappings[$column];
$class = isset($this->declaringClasses[$column])
? $this->declaringClasses[$column]
: $this->class;
@ -162,21 +162,6 @@ class SimpleObjectHydrator extends AbstractHydrator
);
}
if (isset($this->_rsm->relationMap[$column])) {
$class = isset($this->_rsm->relationMap[$column])
? $this->_rsm->relationMap[$column]
: $this->class;
// If class is not self referencing, ignore
if ( ! ($class === $entityName || is_subclass_of($entityName, $class))) {
return null;
}
// TODO: Decide what to do with associations. It seems original code is incomplete.
// One solution is to load the association, but it might require extra efforts.
return array('name' => $column);
}
if (isset($this->_rsm->metaMappings[$column])) {
return array(
'name' => $this->_rsm->metaMappings[$column],
@ -184,6 +169,11 @@ class SimpleObjectHydrator extends AbstractHydrator
);
}
// An ObjectHydrator should be used instead of SimpleObjectHydrator
if (isset($this->_rsm->relationMap[$column])) {
throw new \Exception(sprintf('Unable to retrieve association information for column "%s"', $column));
}
return null;
}
}