Permalink
Browse files

Extended the clear method of the generated Active Record objects so

that when dealing with object/array columns, the _unserialized fields
will be cleared as well.

Bug related tests:
 GeneratedObjectArrayColumnTypeTest::
   testGetterDoesNotKeepValueBetweenTwoHydrationsWhenUsingOnDemandFormatter

 GeneratedObjectArrayColumnTypeTest::
   testGetterDoesNotKeepValueBetweenTwoHydrationsWhenUsingOnDemandFormatter
  • Loading branch information...
1 parent 3ddd790 commit a8145ceb4c314bba918a64a9fd3d846446c845dc @mhitza mhitza committed with willdurand Feb 1, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 generator/lib/builder/om/PHP5ObjectBuilder.php
@@ -5077,6 +5077,11 @@ public function clear()
$script .= "
\$this->".$clo."_isLoaded = false;";
}
+ if($col->getType() == PropelTypes::OBJECT || $col->getType() == PropelTypes::PHP_ARRAY) {
+ $cloUnserialized = $clo.'_unserialized';
+ $script .="
+ \$this->$cloUnserialized = null;";
+ }
}
$script .= "

0 comments on commit a8145ce

Please sign in to comment.