Bitmasks
Using the BitmaskedBehavior of Tools plugin together with Search plugin.
Single Select | Multi Select OR | Multi Select AND
Table
Some example records stored in DB
| Id | Name | Flags raw (bitmasked) | Flags (array) |
|---|---|---|---|
| 1 | Careful | 8 |
|
| 2 | I am promoted | 6 |
|
| 3 | I am a bit more important | 7 |
|
| 4 | I have no flags | 0 | |
| 5 | I am everything | 15 |
|
SQL query
For example/demo purposes here the query it runs as per your filter selection above:SELECT `BitmaskedRecords`.`id` AS `BitmaskedRecords__id`, `BitmaskedRecords`.`name` AS `BitmaskedRecords__name`, `BitmaskedRecords`.`flag_optional` AS `BitmaskedRecords__flag_optional`, `BitmaskedRecords`.`flag_required` AS `BitmaskedRecords__flag_required`, `BitmaskedRecords`.`created` AS `BitmaskedRecords__created`, `BitmaskedRecords`.`modified` AS `BitmaskedRecords__modified` FROM `bitmasked_records` `BitmaskedRecords`

