Skip to content
Browse files

[gh-267] Fix bug caused by failure to cast generated primary key data…

… under php 5.3.

- This primarily affects postgres.
- Specifically this bug was exposed for native autoincrement where
  sequences are used.
  • Loading branch information...
1 parent 9e5a268 commit 14f6958bc8da96ec74e50dfc8fae142f2c39454b @apinstein committed Jan 24, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 generator/lib/builder/om/PHP5ObjectBuilder.php
View
4 generator/lib/builder/om/PHP5ObjectBuilder.php
@@ -4705,7 +4705,9 @@ protected function addDoInsertBodyRaw()
$script .= "
if (null === \$this->{$columnProperty}) {
try {";
- $script .= $platform->getIdentifierPhp('$this->'. $columnProperty, '$con', $primaryKeyMethodInfo, ' ');
+ $script .= $platform->getIdentifierPhp('$newId', '$con', $primaryKeyMethodInfo, ' ');
+ $script .= "
+ \$this->set{$column->getPhpName()}(\$newId);";
$script .= "
} catch (Exception \$e) {
throw new PropelException('Unable to get sequence id.', \$e);

0 comments on commit 14f6958

Please sign in to comment.
Something went wrong with that request. Please try again.