Skip to content

Commit

Permalink
Extended the clear method of the generated Active Record objects so
Browse files Browse the repository at this point in the history
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
mhitza authored and willdurand committed Feb 3, 2012
1 parent 3ddd790 commit a8145ce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions generator/lib/builder/om/PHP5ObjectBuilder.php
Expand Up @@ -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 .= "
Expand Down

0 comments on commit a8145ce

Please sign in to comment.