Get the ValidateType instance for the given name.
@param $validateTypeName The validate type's name
@return ValidateType instance
436974
protected static function getValidateType($validateTypeName) {
    $validatorTypes = ObjectFactory::getInstance('validators');
    if (!isset($validatorTypes[$validateTypeName])) {
      throw new ConfigurationException("Configuration section 'Validators' does not contain a validator named: ".$validateTypeName);
    }
    return $validatorTypes[$validateTypeName];
  }
246584
public function getEventType($eventName) {
        $filter = is_array($eventName) ? $eventName : array(
            'EVENT_NAME' => $eventName,
        );

        $dbres = \CEventType::GetList($filter);
        return $dbres->Fetch();
    }
346367
public function getTypeOfAttribute($attributeName)
    {
        return isset($this->propertyMetadata[$attributeName]) ?
            $this->propertyMetadata[$attributeName]->type : null;
    }
1097807
public function getTypeName()
    {
        if (isset($this->resourceType)) {
            return $this->resourceType;
        }
        $classInfo = explode("\\", get_class($this));
        return end($classInfo);
    }
102494
private function resolveTemplateType($templateType)
    {
        if (is_string($templateType)
            && !$templateType = $this->templateTypeLoader->retrieve($templateTypeName = $templateType)) {
            throw new \InvalidArgumentException(sprintf('Given template type name is invalid, "%s" given.',
                $templateTypeName
            ));
        }
        if ($templateType instanceof TemplateTypeInterface) {
            return $templateType;
        }

        throw new \InvalidArgumentException(sprintf(
            '%s only supports template type names or template type objects, "%s" given.',
            __CLASS__,
            is_object($templateType) ? get_class($templateType) : $templateType
        ));
    }
1037044
protected function validateType($entity, $schema, $entityName)
    {
        if (isset($schema->type)) {
	        $types = $schema->type;
		} else {
			$types = 'any';
            //throw new ValidationException(sprintf('No type given for [%s]', $entityName));
        }

        if (!is_array($types)) {
            $types = array($types);
        }

        $valid = false;

        foreach ($types as $type) {
            switch ($type) {
                case 'object':
                    if (is_object($entity)) {
                        $this->checkTypeObject($entity, $schema, $entityName);
                        $valid = true;
                    }
                    break;
                case 'string':
                    if (is_string($entity)) {
                        $this->checkTypeString($entity, $schema, $entityName);
                        $valid = true;
                    }
                    break;
                case 'array':
                    if (is_array($entity)) {
                        $this->checkTypeArray($entity, $schema, $entityName);
                        $valid = true;
                    }
                    break;
                case 'integer':
                    if (!is_string($entity) && is_int($entity)) {
                        $this->checkTypeInteger($entity, $schema, $entityName);
                        $valid = true;
                    }
                    break;
                case 'number':
                    if (!is_string($entity) && is_numeric($entity)) {
                        $this->checkTypeNumber($entity, $schema, $entityName);
                        $valid = true;
                    }
                    break;
                case 'boolean':
                    if (!is_string($entity) && is_bool($entity)) {
                        $this->checkTypeBoolean($entity, $schema, $entityName);
                        $valid = true;
                    }
                    break;
                case 'null':
                    if (is_null($entity)) {
                        $this->checkTypeNull($entity, $schema, $entityName);
                        $valid = true;
                    }
                    break;
                case 'any':
                    $this->checkTypeAny($entity, $schema, $entityName);
                    $valid = true;
                    break;
                default:
                    // Do nothing
                    $valid = true;
                    break;
            }
        }

        if (!$valid) {
            throw new ValidationException(sprintf('Property [%s] must be one of the following types: [%s]', $entityName, implode(', ', $types)));
        }

        return $this;
    }
205574
protected function getType($rules)
	{
		foreach ($rules as $key => $rule) {
			$parsedRule = $this->parseValidationRule($rule);
			if(in_array($parsedRule['name'], $this->numericRules))
			{
				return 'numeric';
			}
		}

		return 'string';
	}
453511
public function getType($name)
    {
        if (class_exists($name) || interface_exists($name)) {
            if ($this->hasTypeForClass($name)) {
                $name = $this->getTypeForClass($name);
            }
        }

        if (!$this->hasType($name)) {
            throw new \UnexpectedValueException(sprintf('Does not exist a valid definition for "%s" type', $name));
        }

        return $this->types[$name];
    }
826412
public function createInstanceFor($constraintName)
    {
        if (!isset($this->constraintMap[$constraintName])) {
            throw new InvalidArgumentException('Unknown constraint ' . $constraintName);
        }

        if (!isset($this->instanceCache[$constraintName])) {
            $this->instanceCache[$constraintName] = new $this->constraintMap[$constraintName]($this);
        }

        return clone $this->instanceCache[$constraintName];
    }
52975
public static function parse($typeName)
    {
        $normalize = array("int" => self::INTEGER_NAME, 
            "bool" => self::BOOLEAN_NAME, 
            "double" => self::FLOAT_NAME,
            "real" => self::FLOAT_NAME,
            "long" => self::INTEGER_NAME);

        if (isset($normalize[$typeName]))
            $typeName = $normalize[$typeName];

        if (self::$cachedTypes === null)
        {
            self::$cachedTypes = array(
                self::INTEGER_NAME => new PrimitiveType(self::INTEGER_NAME),
                self::FLOAT_NAME => new PrimitiveType(self::FLOAT_NAME),
                self::STRING_NAME => new PrimitiveType(self::STRING_NAME),
                self::BOOLEAN_NAME => new PrimitiveType(self::BOOLEAN_NAME),
                self::MIXED_NAME => new PrimitiveType(self::MIXED_NAME),
                self::RESOURCE_NAME => new PrimitiveType(self::RESOURCE_NAME),
                self::OBJECT_NAME => new PrimitiveType(self::OBJECT_NAME),
                self::NULL_NAME => new PrimitiveType(self::NULL_NAME),
                self::CALLABLE_NAME => new PrimitiveType(self::CALLABLE_NAME));
        }

        if (isset(self::$cachedTypes[$typeName]))
            return self::$cachedTypes[$typeName];

        return null;
    }
828841
public function getType($type_name)
    {
        if (isset($this->types[$type_name])) {
            return $this->types[$type_name];
        } else {
            throw new InvalidArgumentException("Type '$type_name' not found");
        }
    }
1034817
public static function ofObjectType($fullName)
    {
        $result = self::of($fullName);
        if (!($result instanceof ObjectType))
            throw new InvalidArgumentException("Argument 'fullName' does not describe a class or interface.");
        return $result;
    }
1094043
public function extensionsForType(string $extendedTypeName): Collection
    {
        return $this->typeExtensionsMap
            ->filter(function (TypeExtensionNode $typeExtension) use ($extendedTypeName): bool {
                return $extendedTypeName === $typeExtension->name->value;
            });
    }
155300
public static function getValidTypeFromSample($value) {
        $value = trim((string) $value);

        if (empty($value)) {
            return false;
        }

        foreach (self::$validators as $type => $validator) {
            if ($validator === null) {
                continue;
            }

            if (method_exists(__CLASS__, $validator) && self::$validator($value)) {
                return $type;
            }
        }

        return self::__DEFAULT;
    }
102862
protected function getValidationConfiguration(Field $field, $validationName, Validation $validatorConfiguration)
    {
        $acceptsEmptyValues = ValidatorService::get()->validatorAcceptsEmptyValues($validatorConfiguration->getClassName());

        /** @var FormzLocalizationJavaScriptAssetHandler $formzLocalizationJavaScriptAssetHandler */
        $formzLocalizationJavaScriptAssetHandler = $this->assetHandlerFactory->getAssetHandler(FormzLocalizationJavaScriptAssetHandler::class);

        $messages = $formzLocalizationJavaScriptAssetHandler->getTranslationKeysForFieldValidation($field, $validationName);

        return ArrayService::get()->arrayToJavaScriptJson([
            'options'            => $validatorConfiguration->getOptions(),
            'messages'           => $messages,
            'settings'           => $validatorConfiguration->toArray(),
            'acceptsEmptyValues' => $acceptsEmptyValues
        ]);
    }
991981
protected function getValidationRule($inputName)
    {
        $rules = $this->getValidationRules();

        return is_array($rules[$inputName]) ? $rules[$inputName] : explode('|', $rules[$inputName]);
    }
1156905
private function getValidation(string $name): validator\Validation
    {
        if (!isset($this->validations[$name])) {
            if (isset($this->validationRegister[$name])) {
                $class = $this->validationRegister[$name];
            } else {
                throw new exceptions\ValidatorException("Validator [$name] not found");
            }

            $params = isset($this->validationData[$name]) ? $this->validationData[$name] : null;
            $this->validations[$name] = new $class($params);
        }
        return $this->validations[$name];
    }