LimeSurvey API - Master branch

FormatterYnToBool
in package
implements FormatterInterface

Table of Contents

Interfaces

FormatterInterface

Methods

format()  : mixed|null
Cast y/n to boolean
apply()  : bool|string|null
Cast y/n to boolean
revert()  : mixed|null
Cast boolean to y/n

Methods

format()

Cast y/n to boolean

public format(mixed|null $value[, array<string|int, mixed> $config = [] ][, array<string|int, mixed> $options = [] ]) : mixed|null

Converts 'Y' or 'y' to boolean true. Converts 'N' or 'n' to boolean false. Any other value will produce null.

Parameters
$value : mixed|null
$config : array<string|int, mixed> = []
$options : array<string|int, mixed> = []
Return values
mixed|null

apply()

Cast y/n to boolean

protected apply(string|null $value) : bool|string|null

Converts 'Y' or 'y' to boolean true. Converts 'N' or 'n' to boolean false. Any other value will produce null.

Parameters
$value : string|null
Return values
bool|string|null

revert()

Cast boolean to y/n

protected revert(mixed|null $value[, array<string|int, mixed> $config = [] ]) : mixed|null

Converts boolean true 'y'. Converts boolean false to 'n'. Any other value will produce null.

Parameters
$value : mixed|null
$config : array<string|int, mixed> = []
Return values
mixed|null

        
On this page

Search results