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;
    }
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;
    }
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 ; }
Set the code length.

@param int $value between 6 and 20.
@throws \Exception if the code length is not between the default and max lenght defined.
@return object the current instance.
Set the code length .