Permalink
Browse files

Merge pull request #11 from StudioEcho/master

#Issue 10
  • Loading branch information...
2 parents 85b91f2 + 9da11ce commit 7cb5e171542f64981d469e17f4760a7fff92a14c @willdurand willdurand committed Dec 29, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/templates/parent/addInitListRelatedPKs.php
View
7 src/templates/parent/addInitListRelatedPKs.php
@@ -28,17 +28,18 @@ protected function initList<?php echo $pluralRefTableName ?>PKs(PropelPDO $con =
<?php echo $tablePk ?> IN (
SELECT <?php echo $refColumn1 . "\n" ?>
FROM <?php echo $middleTableName . "\n" ?>
- WHERE <?php echo $refColumn2 ?> = :<?php echo $pkName . "\n" ?>
+ WHERE <?php echo $refColumn2 ?> = ?
)
OR
<?php echo $tablePk ?> IN (
SELECT <?php echo $refColumn2 . "\n" ?>
FROM <?php echo $middleTableName . "\n" ?>
- WHERE <?php echo $refColumn1 ?> = :<?php echo $pkName . "\n" ?>
+ WHERE <?php echo $refColumn1 ?> = ?
)";
$stmt = $con->prepare($sql);
- $stmt->bindValue(':<?php echo $pkName ?>', $this->getPrimaryKey(), PDO::PARAM_INT);
+ $stmt->bindValue(1, $this->getPrimaryKey(), PDO::PARAM_INT);
+ $stmt->bindValue(2, $this->getPrimaryKey(), PDO::PARAM_INT);
$stmt->execute();
$this-><?php echo $varListRelatedPKs ?> = $stmt->fetchAll(PDO::FETCH_COLUMN);

0 comments on commit 7cb5e17

Please sign in to comment.