-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allowEmptyStringValues() does not accept custom property/column names #13477
Labels
Comments
CameronHall
added a commit
to CameronHall/cphalcon
that referenced
this issue
Dec 24, 2018
…s adhere col map allowEmptyStrings and skipAttributes will follow the column mapping from now on.
Merged
3 tasks
CameronHall
added a commit
to CameronHall/cphalcon
that referenced
this issue
Dec 24, 2018
…s adhere col map allowEmptyStrings and skipAttributes will follow the column mapping from now on.
niden
pushed a commit
that referenced
this issue
Dec 24, 2018
Addressed in #13692 |
This is still an issue in Phalcon 4.0.4 |
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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 by
columnMap()
inallowEmptyStringValues()
, also. Please change this behaviour.The text was updated successfully, but these errors were encountered: