Closed go-source closed 7 years ago
0 is consider as empty for PHP, so it is expected.
You can use EmptyNonZero behaviour if needed (but it will apply the behaviour on the whole model).
Exactly that. It's the intended default behaviour. You should only use 0/1 in tinyint fields when they are flags (on/off). Then you should use the Boolean field type to display them, NOT the Model field.
The Model field has a very different reason of existence. It's there to manage one-to-one or one-to-many relation field, i.e. foreign keys. For instance, if my Item has a field for a Category ID it makes sense to use a Model field to display the category name instead of its numeric ID but use the category ID on save. That's what the Model field does.
Since the intended use of the fields is already noted in the Wiki there is no need to add or change anything there. This was a simple case of using the wrong tool for the task at hand. It happens :)
I am using Model Field and it does not filter on zero integer: