Skip to content

Model Object

toggle()

toggle() — returns boolean

Available in: model Category: CRUD Functions

Assigns to the property specified the opposite of the property’s current boolean value. Throws an error if the property cannot be converted to a boolean value. Returns this object if save called internally is false.

NameTypeRequiredDefaultDescription
propertystringyes
savebooleannotrueArgument to decide whether save the property after it has been toggled.