propelorm/Propel — Issue #264: enum mutator generator - modification detection quirk
Author: pkschweiger
Created: 2012-01-19 10:52:00+00:00
State: open

enum columns php type is string and PHP5ObjectBuilder's hydration generator casts member variable to string.

enum mutator function generator translates string values via array_search() on the type's value set. array_search() on the numerically indexed value set returns an integer, which in turn prevents the check for gratuitous call to the mutator from getting it's job done.

some quick fixes in PHP5ObjectBuilder::addEnumMutator() include:

* casting array_search() value to column's php type (string) as hydration generator does
* taking comparison against original value from !== to less stringent !=