Closed mohahn closed 5 years ago
@niden I may as well fix this when I do #12975
Addressed in https://github.com/phalcon/cphalcon/pull/13692
This is still an issue in Phalcon 4.0.4
allowEmptyStringValues
does not recognize columnMap()
I have to use real column name instead.
allowEmptyStringValues(), from the name it does allow empty string by excluding column if it is empty but PHPDOcs block made me confuse that it says it skip on update but when field has other than empty value it allows to update.
I'm using Phalcon 3.4.0 Regarding #440 I'm not happy with the solution of using
allowEmptyStringValues()
but as it's the only solution it should use custom property names. When using a database table with underscore in column names (i.e.match_type
) I'm able to create the following modelWhen defining relationships inside
initialize()
method I'm able to use this camel-case notation for columns, but when usingallowEmptyStringValues([ 'matchType' ])
this does not work. I'm still getting validation error, thatmatchType is required
. This empty-string workaround is only working when using real table column names, likeallowEmptyStringValues([ 'match_type' ])
. So when I'm allowed to use camel-case notation for defining relationships to other models, I should be able to use property names defined bycolumnMap()
inallowEmptyStringValues()
, also. Please change this behaviour.