Bitmasks

Using the BitmaskedBehavior of Tools plugin.

Optional (nullable) field | Required (not nullable) field

Table

Some example records stored in DB

Id Name Flags raw (bitmasked) Flags (array)
1 Careful 8
  • 8 (Flagged)
2 I am promoted 6
  • 2 (Featured)
  • 4 (Approved)
3 I am a bit more important 7
  • 1 (Important)
  • 2 (Featured)
  • 4 (Approved)
4 I have no flags 0
    5 I am everything 15
    • 1 (Important)
    • 2 (Featured)
    • 4 (Approved)
    • 8 (Flagged)

    Demo for nullable bitmask field `flag_optional`

    Add Entry

    Send your feedback or bugreport!