Menu

Maslosoft Mangan Logo Maslosoft Mangan Documentation
MongoDB Object Persister

Edit

Boolean Sanitizer

Boolean sanitizer will ensure that value is either true or false.

It is recommended to use either default value of true or false to auto set this sanitizer or explicitly define it with class literal.

Full example of using BooleanSanitizer:

use Maslosoft\Addendum\Interfaces\AnnotatedInterface
use Maslosoft\Mangan\Sanitizers\BooleanSanitizer;

class MyClass implements AnnotatedInterface
{
    public $autodetected = true;

    /**
    * @Sanitizer(BooleanSanitizer)
    */
    public $explicitlySet;
}