Fix for class/alias relation generation.
This commit is contained in:
parent
3b0f749a58
commit
5bec1b2224
@ -208,7 +208,8 @@ END;
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($relations as $name => $relation) {
|
foreach ($relations as $name => $relation) {
|
||||||
$alias = (isset($relation['alias']) && $relation['alias'] !== $name) ? ' as ' . $relation['alias'] : '';
|
$class = isset($relation['class']) ? $relation['class']:$name;
|
||||||
|
$alias = (isset($relation['alias']) && $relation['alias'] !== $relation['class']) ? ' as ' . $relation['alias'] : '';
|
||||||
|
|
||||||
if ( ! isset($relation['type'])) {
|
if ( ! isset($relation['type'])) {
|
||||||
$relation['type'] = Doctrine_Relation::ONE;
|
$relation['type'] = Doctrine_Relation::ONE;
|
||||||
@ -216,9 +217,9 @@ END;
|
|||||||
|
|
||||||
if ($relation['type'] === Doctrine_Relation::ONE ||
|
if ($relation['type'] === Doctrine_Relation::ONE ||
|
||||||
$relation['type'] === Doctrine_Relation::ONE_COMPOSITE) {
|
$relation['type'] === Doctrine_Relation::ONE_COMPOSITE) {
|
||||||
$ret[$i] = ' $this->hasOne(\'' . $name . $alias . '\'';
|
$ret[$i] = ' $this->hasOne(\'' . $class . $alias . '\'';
|
||||||
} else {
|
} else {
|
||||||
$ret[$i] = ' $this->hasMany(\'' . $name . $alias . '\'';
|
$ret[$i] = ' $this->hasMany(\'' . $class . $alias . '\'';
|
||||||
}
|
}
|
||||||
|
|
||||||
$a = array();
|
$a = array();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user