Closed cristianoc72 closed 7 years ago
Yeah, unfortunately, they changed it.
This is why I added a MethodDefinition
that extends Propel\Generator\Builder\PhpModel
in Propel2: https://github.com/propelorm/Propel2/blob/data-mapper/src/Propel/Generator/Builder/PhpModel/MethodDefinition.php#L17
@marcj My fix is buggy: getExpression
function must return a string, otherwise the writer can't correctly write down the class. I'm workingon it.
Yes, this is changed, because it was to unreliable to generate what kind of value you put in, see here: https://php-code-generator.readthedocs.io/en/latest/model.html#understanding-values
I'd say you should avoid using addSimpleParameter
methods. Since the introduction of values and expressions, these methods are unreliable in what you want and they stand out of the rest of the API, they should go deprecated in the next versions. You should build your own wrapper or shortcut function for your own use-case, I think that's way better.
In
gossi\codegen\model\parts\ParameterParts
trait,addSimpleParameter
andaddSimpleDescParameter
functions don't accept anymore arrays as default value.This use case throws an Exception, because at https://github.com/gossi/php-code-generator/blob/master/src/model/parts/ParametersPart.php#L82 and at https://github.com/gossi/php-code-generator/blob/master/src/model/parts/ParametersPart.php#L105 the instructions accept only primitive values.
Is it a desired behavior? If yes, I'll refactor some Propel classes, otherwise I can submit a fix.