Closed Nyde closed 3 years ago
This is NFR.
Wont be done, because of camelize
behavior, which is needed for fields named like group_id
.
Changing template behavior to make Barcode
be consistent breaks snake_cased fields name mutation.
As said in forums thread, ill recommend to rename fields such as Barcode
to barcode
or manually change columnMap() method to fulfill that needs.
Somehow fixed in #1498
Please see the discussion on the forum (https://forum.phalcon.io/discussion/20661/modelsave-saves-not-the-entire-model-return-xy-is-required) and the accepted answer (https://forum.phalcon.io/discussion/20661/modelsave-saves-not-the-entire-model-return-xy-is-required#C63301).
Actual Behavior
When you create a model from a table that has capitalized columns, the property is saved in lower case. However, the column map exspects the field name with a leading capital letter, therefore yields "xy is required" on
save()
.See this table definition:
Note the capitalized "B" of "Barcode".
The model generated by webtools.php:
When trying to
save()
, this yields "Barcode is required", even if set. Internally,$this->barcode
gets set bysetBarcode('somestring');
, but the column map generated by webtools.php exspects the field to be named$this->Barcode
.Exspected behaviour
webtools.php should match the keys from the column map with the actual property names, with correct capitalization taken into account.
Details