From db9fc298deace8a9f0277edafca87669c91953b6 Mon Sep 17 00:00:00 2001 From: Matthew Leffler Date: Fri, 5 Dec 2014 13:14:55 -0700 Subject: [PATCH] Correct PK column constant in parent classes for tablePrefix --- src/EqualNestParentBehaviorObjectBuilderModifier.php | 4 ++-- src/templates/parent/addGetRelatedCollection.php | 2 +- src/templates/parent/countObjectsInRelatedCollection.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/EqualNestParentBehaviorObjectBuilderModifier.php b/src/EqualNestParentBehaviorObjectBuilderModifier.php index 8ca884b..50db1c7 100644 --- a/src/EqualNestParentBehaviorObjectBuilderModifier.php +++ b/src/EqualNestParentBehaviorObjectBuilderModifier.php @@ -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/'); } @@ -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/'); } diff --git a/src/templates/parent/addGetRelatedCollection.php b/src/templates/parent/addGetRelatedCollection.php index a34bd6e..9b2cb74 100644 --- a/src/templates/parent/addGetRelatedCollection.php +++ b/src/templates/parent/addGetRelatedCollection.php @@ -24,7 +24,7 @@ public function get(Criteria $criteria = null, $this->init(); } else { $newCollection = ::create(null, $criteria) - ->addUsingAlias(getConstantName() ?>, $this->, Criteria::IN) + ->addUsingAlias(, $this->, Criteria::IN) ->find($con); if (null !== $criteria) { diff --git a/src/templates/parent/countObjectsInRelatedCollection.php b/src/templates/parent/countObjectsInRelatedCollection.php index fc1e4d8..ee335d7 100644 --- a/src/templates/parent/countObjectsInRelatedCollection.php +++ b/src/templates/parent/countObjectsInRelatedCollection.php @@ -24,7 +24,7 @@ public function count(Criteria $criteria = null } return $query - ->addUsingAlias(getConstantName() ?>, $this->, Criteria::IN) + ->addUsingAlias(, $this->, Criteria::IN) ->count($con); } } else {