Open auss opened 11 years ago
ping @propelorm
I think it's related to the way behaviors are added to tables: each table have an array of behaviors where the key is the name of the behavior. Now: when you use different behavior statements with the same name attribute, the first one is overridden by last one.
I think it can be fixed easily overriding setupObject() from Behavior.php where the name is set, maybe with the column name concatenated to 'aggregate_column'. In my opinion it's the fastest way to fix this issue but I don't know if it will break something. By the way in documentation it's pointed out that you can use this behavior many times on the same table.
What do you think, @willdurand ?
@andrea-chris you are right.. I thought it was fixed but.. obviously it is not...
Question: is it possible to add an optional "id" parameter to "behavior" tag?
So Propel will use "name" parameter to load behavior class which will use "id" parameter to build its own name if it exists. I think it's the better way to solve this issue and to allow developers to write their own multi-behavior.
Do I miss something?
Comment #222 #issuecomment-62825257 says it works, but with Propel-1.7.1, it doesn't...
When I use aggregate_column more than once, only the last one has generated code. In this example
propel generated only funcitons for last declaration: