Fr3nch13/CakePHP Utilities

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
throws
PersistenceFailedException
TODO

Use a more specific Exception when the save fails

Return values
bool

The set toggled value


        
On this page

Search results