Skip to content

Commit

Permalink
[1.6] Fixed i18n behavior with namespaces (closes #1359)
Browse files Browse the repository at this point in the history
  • Loading branch information
fzaninotto committed Apr 29, 2011
1 parent 327caba commit 813e729
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Expand Up @@ -63,10 +63,11 @@ protected function addUseI18nQuery()
$i18nTable = $this->behavior->getI18nTable();
$fk = $this->behavior->getI18nForeignKey();
return $this->behavior->renderTemplate('queryUseI18nQuery', array(
'queryClass' => $this->builder->getNewStubQueryBuilder($i18nTable)->getClassname(),
'defaultLocale' => $this->behavior->getDefaultLocale(),
'i18nRelationName' => $this->builder->getRefFKPhpNameAffix($fk),
'localeColumn' => $this->behavior->getLocaleColumn()->getPhpName(),
'queryClass' => $this->builder->getNewStubQueryBuilder($i18nTable)->getClassname(),
'namespacedQueryClass' => $this->builder->getNewStubQueryBuilder($i18nTable)->getFullyQualifiedClassname(),
'defaultLocale' => $this->behavior->getDefaultLocale(),
'i18nRelationName' => $this->builder->getRefFKPhpNameAffix($fk),
'localeColumn' => $this->behavior->getLocaleColumn()->getPhpName(),
));
}

Expand Down
Expand Up @@ -14,5 +14,5 @@ public function useI18nQuery($locale = '<?php echo $defaultLocale ?>', $relation
{
return $this
->joinI18n($locale, $relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : '<?php echo $i18nRelationName ?>', '<?php echo $queryClass ?>');
->useQuery($relationAlias ? $relationAlias : '<?php echo $i18nRelationName ?>', '<?php echo $namespacedQueryClass ?>');
}

0 comments on commit 813e729

Please sign in to comment.