Maslosoft Mangan Logo Maslosoft Mangan Documentation
MongoDB Object Persister

Edit

Integer Sanitizer

Integer sanitizer will ensure that value is numeric and it is integer.

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

Full example of using IntegerSanitizer:

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

class MyClass implements AnnotatedInterface
{
    public $autodetected = 0;

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