Permalink
Browse files

Add missing namespace declarations in versionable behavior.

Closes #294.
  • Loading branch information...
1 parent 3d5dc3c commit 1f46f3607c75cf8aa695004e81a32cd4b92214d9 @fzaninotto fzaninotto committed Feb 14, 2012
Showing with 9 additions and 3 deletions.
  1. +9 −3 generator/lib/behavior/versionable/VersionableBehaviorObjectBuilderModifier.php
@@ -315,7 +315,9 @@ public function populateFromVersion(\$version, \$con = null, &\$loadedObjects =
$foreignTable = $fk->getForeignTable();
$foreignVersionTable = $fk->getForeignTable()->getBehavior($this->behavior->getName())->getVersionTable();
$relatedClassname = $this->builder->getNewStubObjectBuilder($foreignTable)->getClassname();
- $relatedVersionQueryClassname = $this->builder->getNewStubQueryBuilder($foreignVersionTable)->getClassname();
+ $relatedVersionQueryBuilder = $this->builder->getNewStubQueryBuilder($foreignVersionTable);
+ $this->builder->declareClassFromBuilder($relatedVersionQueryBuilder);
+ $relatedVersionQueryClassname = $relatedVersionQueryBuilder->getClassname();
$fkColumnName = $fk->getLocalColumnName();
$fkColumnPhpName = $fk->getLocalColumn()->getPhpName();
$fkVersionColumnPhpName = $versionTable->getColumn($fkColumnName . '_version')->getPhpName();
@@ -345,8 +347,12 @@ public function populateFromVersion(\$version, \$con = null, &\$loadedObjects =
$foreignVersionTable = $foreignBehavior->getVersionTable();
$fkColumnIds = $this->behavior->getReferrerIdsColumn($fk);
$fkColumnVersions = $this->behavior->getReferrerVersionsColumn($fk);
- $relatedVersionQueryClassname = $this->builder->getNewStubQueryBuilder($foreignVersionTable)->getClassname();
- $relatedVersionPeerClassname = $this->builder->getNewStubPeerBuilder($foreignVersionTable)->getClassname();
+ $relatedVersionQueryBuilder = $this->builder->getNewStubQueryBuilder($foreignVersionTable);
+ $this->builder->declareClassFromBuilder($relatedVersionQueryBuilder);
+ $relatedVersionQueryClassname = $relatedVersionQueryBuilder->getClassname();
+ $relatedVersionPeerBuilder = $this->builder->getNewStubPeerBuilder($foreignVersionTable);
+ $this->builder->declareClassFromBuilder($relatedVersionPeerBuilder);
+ $relatedVersionPeerClassname = $relatedVersionPeerBuilder->getClassname();
$relatedClassname = $this->builder->getNewStubObjectBuilder($foreignTable)->getClassname();
$fkColumn = $fk->getForeignColumn();
$fkVersionColumn = $foreignVersionTable->getColumn($this->behavior->getParameter('version_column'));

0 comments on commit 1f46f36

Please sign in to comment.