Conditional Set Filters
These filters are helpful if you want update only certain fields in a given database record or object.
Conditional filters are able to be used in place of Conditional (If-then-else) statements for certain use-cases. They will make your business logic appear much smoother and with less headache.They will be extremely helpful when editing a record but you only wish to update fields that are not empty or not null, in addition to updating objects where a field is not null or not empty.
In basic terms, it's a way to say "if this field isn't empty, then update it. But if it has an existing value then leave it alone"
Here are the examples:
first_notempty - returns the first value that is not empty (example shown in the video above)
first_notnull - returns the first value that is not null
set_ifnotempty - Good for updating objects. (example shown 4m in the video above)
set_ifnotnull - Similar to above, but useful for when you are dealing with null values.
Last updated