Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #254 from fzaninotto/aggregate_namespace

[aggregate] Fix behavior when used with namespaces.
  • Loading branch information...
commit a77a4cf42cc9a1e39634866ae9cf1f4619795930 2 parents 7c5bfe9 + aa7870b
@willdurand willdurand authored
View
4 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.
Something went wrong with that request. Please try again.