ToggleTrait
Toggle Trait
Common methods for toggling boolean fields in the database.
Table of Contents
Methods
- toggle() : bool
- Allows toggling of boolean fields.
Methods
toggle()
Allows toggling of boolean fields.
public
toggle(int $id, string $field) : bool
Parameters
- $id : int
-
The record id to update.
- $field : string
-
The field to toggle.
Tags
Return values
bool —The set toggled value