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 {