public function setCodeLength($value)
    {
        $this->codeLength = filter_var(
            $value,
            FILTER_VALIDATE_INT,
            array(
                'options' => array(
                    'min_range' => self::CODE_LENGTH_DEFAULT,
                    'max_range' => self::CODE_LENGTH_MAX
                )
            )
        );

        if (!$this->codeLength) {
            throw new \Exception('The code length have to be between 6 and 20 included.');
        }

        return $this;
    }