Skip to content

Commit

Permalink
Correct PK column constant in parent classes for tablePrefix
Browse files Browse the repository at this point in the history
  • Loading branch information
mattleff committed Dec 5, 2014
1 parent ae192b1 commit db9fc29
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/EqualNestParentBehaviorObjectBuilderModifier.php
Expand Up @@ -155,7 +155,7 @@ protected function addGetRelatedCollection($builder)
'queryClassname' => $builder->getStubQueryBuilder()->getClassname(),
'varListRelatedPKs' => $this->getEqualNestListPksName($builder),
'varRelatedObjectsColl' => $this->getEqualNestCollectionName($builder),
'pk' => $this->behavior->getFirstPrimaryKey(),
'pk' => $builder->getStubObjectBuilder()->getColumnConstant( $this->behavior->getFirstPrimaryKey() ),
), '/templates/parent/');
}

Expand Down Expand Up @@ -215,7 +215,7 @@ protected function countObjectsInRelatedCollection($builder)
'varListRelatedPKs' => $this->getEqualNestListPksName($builder),
'varRelatedObjectsColl' => $this->getEqualNestCollectionName($builder),
'queryClassname' => $builder->getStubQueryBuilder()->getClassname(),
'pk' => $this->behavior->getFirstPrimaryKey(),
'pk' => $builder->getStubObjectBuilder()->getColumnConstant( $this->behavior->getFirstPrimaryKey() ),
), '/templates/parent/');
}

Expand Down
2 changes: 1 addition & 1 deletion src/templates/parent/addGetRelatedCollection.php
Expand Up @@ -24,7 +24,7 @@ public function get<?php echo $pluralRefTableName ?>(Criteria $criteria = null,
$this->init<?php echo $pluralRefTableName ?>();
} else {
$newCollection = <?php echo $queryClassname ?>::create(null, $criteria)
->addUsingAlias(<?php echo $pk->getConstantName() ?>, $this-><?php echo $varListRelatedPKs ?>, Criteria::IN)
->addUsingAlias(<?php echo $pk ?>, $this-><?php echo $varListRelatedPKs ?>, Criteria::IN)
->find($con);

if (null !== $criteria) {
Expand Down
2 changes: 1 addition & 1 deletion src/templates/parent/countObjectsInRelatedCollection.php
Expand Up @@ -24,7 +24,7 @@ public function count<?php echo $pluralRefTableName ?>(Criteria $criteria = null
}

return $query
->addUsingAlias(<?php echo $pk->getConstantName() ?>, $this-><?php echo $varListRelatedPKs ?>, Criteria::IN)
->addUsingAlias(<?php echo $pk ?>, $this-><?php echo $varListRelatedPKs ?>, Criteria::IN)
->count($con);
}
} else {
Expand Down

0 comments on commit db9fc29

Please sign in to comment.