You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This throws an exception if the "my_field" field is already assigned with a type in the base class. This is a bug because it was not the case in 1.1 and I think it should be possible.
There are several ways of solving that problem:
1° Create an "overrideField" method
2° Add a $force flag to addField (default to false)
3° Remove the exception from addField (like it was in 1.1)
Any thoughts ?
The text was updated successfully, but these errors were encountered:
I think #3 - Why was the exception added there in the first place?
Is it dangerous to override the field definition? Would it lead to instability or undefined behaviour?
If the exception is there to notify the programmer that they may be doing something wrong I vote remove it altogether and document the behaviour in your examples. Removing it would allow for the programmer to redefine the field type to something custom and setup a Converter to handle the data. (see https://groups.google.com/forum/?fromgroups=#!topic/pommproject/FaCGbC2p1Bg).
I do agree on option 3. We can trust the the generated classes since the generator is tested. If the programer wish was to add a non db existent field, he would use addVirtualField so using addField means "add or replace definition".
Last, this change does not create a compatibility problem nor a regression but is is not a new feature either (stable branch policy).
In 1.1, it was possible to override a field definition. The RowStructure class prevents that:
This throws an exception if the "my_field" field is already assigned with a type in the base class. This is a bug because it was not the case in 1.1 and I think it should be possible.
There are several ways of solving that problem:
1° Create an "overrideField" method
2° Add a $force flag to addField (default to false)
3° Remove the exception from addField (like it was in 1.1)
Any thoughts ?
The text was updated successfully, but these errors were encountered: