Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.2.0-BETA1
-
Fix Version/s: 1.2.0-BETA2
-
Component/s: Import/Export
-
Labels:None
-
Environment:PHP 5.2.x, Windows (All)
Description
Doctrine_Import_Builder, line 383
$alias = (isset($relation['alias']) && $relation['alias'] !== $relation['class']) ? ' as ' . $relation['alias'] : '';
For example, if both class name and alias is "User" and we make use of classPrefix (i.e "Model_"), the generated class name will actually be "Model_User". The comparison of:
$relation['alias'] !== $relation['class']
does not cover the prefix, which lead to the missing of alias when generating models, i.e
$this->hasOne('Model_User', ...
instead of
$this->hasOne('Model_User as User', ...
Suggested fix:
$alias = (isset($relation['alias']) && $relation['alias'] !== $this->_classPrefix . $relation['class']) ? ' as ' . $relation['alias'] : '';