Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #295 from fzaninotto/versionable_namespace

Add missing namespace declarations in versionable behavior.
  • Loading branch information...
commit 0eacc54d8c265448e14e2b1632a2c43433b4106c 2 parents 3d5dc3c + 1f46f36
William Durand willdurand authored
12 generator/lib/behavior/versionable/VersionableBehaviorObjectBuilderModifier.php
View
@@ -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'));
Please sign in to comment.
Something went wrong with that request. Please try again.