Permalink
Browse files

Merge pull request #254 from fzaninotto/aggregate_namespace

[aggregate] Fix behavior when used with namespaces.
  • Loading branch information...
2 parents 7c5bfe9 + aa7870b commit a77a4cf42cc9a1e39634866ae9cf1f4619795930 @willdurand willdurand committed Jan 9, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 generator/lib/behavior/aggregate_column/AggregateColumnRelationBehavior.php
@@ -116,12 +116,14 @@ public function queryMethods($builder)
protected function addQueryFindRelated($builder)
{
$foreignKey = $this->getForeignKey();
+ $foreignQueryBuilder = $builder->getNewStubQueryBuilder($foreignKey->getForeignTable());
+ $builder->declareClass($foreignQueryBuilder->getFullyQualifiedClassname());
$relationName = $this->getRelationName($builder);
return $this->renderTemplate('queryFindRelated', array(
'foreignTable' => $this->getForeignTable(),
'relationName' => $relationName,
'variableName' => self::lcfirst($relationName),
- 'foreignQueryName' => $foreignKey->getForeignTable()->getPhpName() . 'Query',
+ 'foreignQueryName' => $foreignQueryBuilder->getClassname(),
'refRelationName' => $builder->getRefFKPhpNameAffix($foreignKey),
));
}

0 comments on commit a77a4cf

Please sign in to comment.