Sets a new barcode validator

@param  string $barcodeType - Barcode validator to use
@return void
@throws Zend_Validate_Exception
176813
public function setType($barcodeType)
    {
        switch (strtolower($barcodeType)) {
        case 'upc':
        case 'upc-a':
            $className = 'UpcA';
            break;
        case 'ean13':
        case 'ean-13':
            $className = 'Ean13';
            break;
        default:
            include_once 'Zend/Validate/Exception.php';
            throw new Zend_Validate_Exception("Barcode type '$barcodeType' is not supported'");
                break;
        }

        include_once 'Zend/Validate/Barcode/' . $className . '.php';

        $class = 'Zend_Validate_Barcode_' . $className;
        $this->_barcodeValidator = new $class;
    }
963204
public function setEventType($eventType) {
        $this->setVariable(self::EVENT_TYPE, $this->assembleAssignmentString(self::DATA_EVENT, $eventType));
    }
44754
public static function setDbType($dbType) {
        $dbTypeCast = (string) $dbType;
        
        if (array_search($dbTypeCast, self::$dbList) === false) {
            throw new DBException('Illegal database type provided to DB Service');
        }
        
        self::$dbType = $dbTypeCast;
    }
30156
protected function validateBlockType($blockType)
    {
        if (!$blockType) {
            throw new Exception\InvalidArgumentException('The block type name must not be empty.');
        }
        if (!$blockType instanceof BlockTypeInterface) {
            if (!is_string($blockType)) {
                throw new Exception\UnexpectedTypeException($blockType, 'string or BlockTypeInterface', 'blockType');
            }
            if (!preg_match('/^[a-z][a-z0-9_]*$/iD', $blockType)) {
                throw new Exception\InvalidArgumentException(
                    sprintf(
                        'The "%s" string cannot be used as the name of the block type '
                        . 'because it contains illegal characters. '
                        . 'The valid block type name should start with a letter and only contain '
                        . 'letters, numbers and underscores ("_").',
                        $blockType
                    )
                );
            }
        }
    }
637228
public function setMailType($type)
    {
        switch($type){
            case Mail::MAIL_TYPE_HTML:
                $this->mailTypeHeaders = array();
                $this->mailTypeHeaders[] = 'MIME-Version: 1.0';
                $this->mailTypeHeaders[] = 'Content-type: text/html; charset=UTF-8';
                break;
            case Mail::MAIL_TYPE_PLAIN:
                $this->mailTypeHeaders = array();
                break;
        }
    }
945160
public function setType($type)
    {
        if (gettype($type) === 'string') {
            $this->type = $type;
        } else {
            $msg = "Type must be a string, '" . gettype($type) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
404060
public function setType($type)
    {
        // check type
        if (!in_array($type, array(self::AUTO, self::ISBN10, self::ISBN13))) {
            /**
             * @see Zend_Validate_Exception
             */

            throw new Zend_Validate_Exception('Invalid ISBN type');
        }

        $this->_type = $type;
        return $this;
    }
705554
public function setType($type)
    {
        if (!in_array($type,[$this::WORK, $this::HOME, $this::MOBILE, $this::FAX]))
        {
            throw new InvalidArgumentException("Type is not a valid type. You must use one of the constants in the PhoneNumber class as the type.");
        }
        $this->type = $type;
    }
388513
protected function validate_data() {
        parent::validate_data();

        if (!isset($this->other['langcode'])) {
            throw new \coding_exception('The \'langcode\' value must be set');
        }

        $cleanedlang = clean_param($this->other['langcode'], PARAM_LANG);
        if ($cleanedlang !== $this->other['langcode']) {
            throw new \coding_exception('The \'langcode\' value must be set to a valid language code');
        }
    }
1245243
public function setCode($code)
    {
        if ($code instanceof PagSeguroPaymentMethodCode) {
            $this->code = $code;
        } else {
            $this->code = new PagSeguroPaymentMethodCode($code);
        }
    }
97187
public function setType($type)
    {
      if(!is_string($type) || strlen(trim($type)) == 0)
        throw new InvalidArgumentException(__METHOD__ . '; Invalid type, must be a non empty string');

      $this->type = $type;
    }
614962
public function setBannerType($bannerType) {
    if (!in_array($bannerType, [
        self::BANNER_TYPE_ANY,
        self::BANNER_TYPE_DOUBLE,
        self::BANNER_TYPE_LARGE,
        self::BANNER_TYPE_STANDARD,
      ])) {
      $this->triggerError('Invalid value for bannerType advertisingSettings.');
    }
    else {
      $this->bannerType = $bannerType;
    }
    return $this;
  }
1097424
protected function setType(string $type) : void
    {
        if (empty($type)) {
            throw new InvalidArgumentException(__CLASS__ . ': Empty field type is not allowed');
        }

        if (! in_array($type, array_keys($this->defaultOptions))) {
            throw new InvalidArgumentException(__CLASS__ . ': Unsupported field type: ' . $type);
        }

        $this->type = $type;
    }
554367
public function setTokenType(TokenTypeInterface $tokenType)
    {
        $this->issuer->setTokenType($tokenType);
        $this->checker->setTokenType($tokenType);
    }
365749
protected function _setValidator($validator)
    {
        if (!is_null($validator) && !($validator instanceof ValidatorInterface)) {
            throw $this->_createInvalidArgumentException($this->__('Invalid validator'), null, null, $validator);
        }

        $this->validator = $validator;
    }
112465
public function setEncoding(int $enc_type)
    {
        static $enc_type_list;
        if (null === $enc_type_list) {
            $enc_type_list = [
                self::RFC1738_ENCODING => 1,
                self::RFC3986_ENCODING => 1,
                self::RFC3987_ENCODING => 1,
                self::NO_ENCODING => 1,
            ];
        }

        if (!isset($enc_type_list[$enc_type])) {
            throw new InvalidArgumentException(sprintf('Unsupported or Unknown Encoding: %s', $enc_type));
        }

        $this->enc_type = $enc_type;
    }
1070207
protected function setValidator()
    {
        // Get query data
        if (!isset($_SERVER['REQUEST_METHOD'])) {
            throw new Exception('Error: The server request method is not set.');
        }
        $queryData = [];
        switch ($_SERVER['REQUEST_METHOD']) {
            case 'GET':
                $queryData = $_GET;
                break;
            case 'POST':
                $queryData = $_POST;
                break;
            default:
                $input = fopen('php://input', 'r');
                $qData = null;
                while ($data = fread($input, 1024)) {
                    $qData .= $data;
                }
                parse_str($qData, $queryData);
        }
        // If there is query data, set validator to check against the token value
        if (count($queryData) > 0) {
            $val = (isset($queryData[$this->name])) ? $queryData[$this->name] : '';
            $this->addValidator(new \Pop\Validator\Equal($val, 'The security token does not match.'));
        }
    }