Adds a data type definition.

@param string $typeName Name of the type.
@param string $typeClass The class to use.
@param string $classpath The classpath to use.
5938
public function addDataTypeDefinition($typeName, $typeClass, $classpath = null)
    {
        ComponentHelper::getComponentHelper($this)->addDataTypeDefinition($typeName, $typeClass, $classpath);
    }
664817
public function registerTypeDataModule(ITypeDataModule $module)
    {
        $this->typeDataModules[] = $module;
        foreach ($module->functions() as $name => $returnType) {
            $normalizedFunctionName                         = $this->normalizeFunctionName($name);
            $this->functionTypeMap[$normalizedFunctionName] = $returnType;
            unset($this->functions[$normalizedFunctionName]);
        }

        foreach ($module->types() as $name => $typeData) {
            $normalizedClassName                      = $this->normalizeClassName($name);
            $this->classTypeMap[$normalizedClassName] = $typeData;
            unset($this->objectTypes[$normalizedClassName]);
        }
    }
645190
public function addTaskDefinition($name, $class, $classpath = null)
    {
        if ($class === "") {
            $this->project->log("Task $name has no class defined.", Project::MSG_ERR);
        } elseif (!isset($this->taskdefs[$name])) {
            Phing::import($class, $classpath);
            $this->taskdefs[$name] = $class;
            $this->project->log("  +Task definition: $name ($class)", Project::MSG_DEBUG);
        } else {
            $this->project->log("Task $name ($class) already registered, skipping", Project::MSG_VERBOSE);
        }
    }
160494
public function setClassTypes($classTypes)
    {
        if ($classTypes) {
            if (\is_string($classTypes)) {
                if (!\in_array($classTypes, $this->classTypes)) {
                    $this->classTypes[] = $classTypes;
                }
            } else {
                foreach ($classTypes as $classType) {
                    if (!\in_array($classType, $this->classTypes)) {
                        $this->classTypes[] = $classType;
                    }
                }
            }
        }
    }
916912
public function setTypeFromString($typeName, $size)
    {
        $tn = strtoupper($typeName);
        $this->setType($tn);

        if ($size !== null) {
            $this->size = $size;
        }

        if (strpos($tn, "CHAR") !== false) {
            $this->domain->setType(PropelTypes::VARCHAR);
        } elseif (strpos($tn, "INT") !== false) {
            $this->domain->setType(PropelTypes::INTEGER);
        } elseif (strpos($tn, "FLOAT") !== false) {
            $this->domain->setType(PropelTypes::FLOAT);
        } elseif (strpos($tn, "DATE") !== false) {
            $this->domain->setType(PropelTypes::DATE);
        } elseif (strpos($tn, "TIME") !== false) {
            $this->domain->setType(PropelTypes::TIMESTAMP);
        } elseif (strpos($tn, "BINARY") !== false) {
            $this->domain->setType(PropelTypes::LONGVARBINARY);
        } else {
            $this->domain->setType(PropelTypes::VARCHAR);
        }
    }
135994
function typeClass() {
      Components.Html.root.classList.add(Glide.settings.classes[Glide.settings.type]);
    }
896688
public static function addType($type, $class)
    {
        if (static::hasType($type)) {
            throw TypeException::typeAlreadyExists($type);
        }

        if (!class_exists($class)) {
            throw TypeException::classNotFound($class);
        }

        if (!in_array('Fridge\DBAL\Type\TypeInterface', class_implements($class))) {
            throw TypeException::typeMustImplementTypeInterface($class);
        }

        static::$mappedTypeClasses[$type] = $class;
    }
1281540
public function create(string $className, string $typeName): Type
    {
        $type = new InputObjectType([
            'name' => $typeName,
            'description' => 'Type to specify conditions on fields',
            'fields' => function () use ($className, $typeName): array {
                $filters = [];
                $metadata = $this->entityManager->getClassMetadata($className);

                // Get custom operators
                $this->readCustomOperatorsFromAnnotation($metadata->reflClass);

                // Get all scalar fields
                foreach ($metadata->fieldMappings as $mapping) {
                    if ($mapping['id'] ?? false) {
                        $leafType = Type::id();
                    } else {
                        /** @var LeafType $leafType */
                        $leafType = $this->types->get($mapping['type']);
                    }

                    $fieldName = $mapping['fieldName'];
                    $operators = $this->getOperators($fieldName, $leafType, false, false);

                    $filters[] = $this->getFieldConfiguration($typeName, $fieldName, $operators);
                }

                // Get all collection fields
                foreach ($metadata->associationMappings as $mapping) {
                    $fieldName = $mapping['fieldName'];
                    $operators = $this->getOperators($fieldName, Type::id(), true, $metadata->isCollectionValuedAssociation($fieldName));

                    $filters[] = $this->getFieldConfiguration($typeName, $fieldName, $operators);
                }

                // Get all custom fields defined by custom operators
                foreach ($this->customOperators as $fieldName => $customOperators) {
                    $operators = [];
                    /** @var Filter $customOperator */
                    foreach ($customOperators as $customOperator) {
                        /** @var LeafType $leafType */
                        $leafType = $this->types->get($customOperator->type);
                        $operators[$customOperator->operator] = $leafType;
                    }

                    $filters[] = $this->getFieldConfiguration($typeName, $fieldName, $operators);
                }

                return $filters;
            },
        ]);

        return $type;
    }
960979
public <T extends Sink> void addSinkType(String typeName, Class<T> sinkClass) {
        LOG.info("Adding sinkType: " + typeName + " -> " + sinkClass.getCanonicalName());
        
        Multibinder<TypeHolder> bindings
            = Multibinder.newSetBinder(binder(), TypeHolder.class);
        bindings.addBinding().toInstance(new TypeHolder(typeName, sinkClass));
    }
266460
public static function addType(string $name, string $className) : void
    {
        if (isset(self::$typesMap[$name])) {
            throw MappingException::typeExists($name);
        }

        self::$typesMap[$name] = $className;
    }
869607
public function create(string $className, string $typeName): Type
    {
        $type = new InputObjectType([
            'name' => $typeName,
            'description' => 'Type to specify join tables in a filter',
            'fields' => function () use ($className): array {
                return $this->getJoinsFields($className);
            },
        ]);

        return $type;
    }
131782
public function autoload($classpath)
    {
        $this->_registeredNamespace = false;

        list($namespace, $classname) = $this->normalizeClassname($classpath);

        if ($this->autoloadThrowWrappers($namespace, $classname) || $this->autoloadThrowFilesystem($namespace, $classname)) {
            if (NAMESPACE_SEPARATOR == substr($classpath, 0, 1)) {
                $classpath = substr($classpath, 1);
            }

            if (null !== $this->getEventDispatcher() && is_subclass_of($classpath, 'BackBee\ClassContent\AbstractClassContent')) {
                $this->getEventDispatcher()->triggerEvent('include', new $classpath());
            }

            return;
        }

        if (true === $this->_registeredNamespace) {
            throw new Exception\ClassNotFoundException(sprintf('Class %s%s%s not found.', $namespace, NAMESPACE_SEPARATOR, $classname));
        }
    }
108214
public function registerType($typeName, $className)
    {
        if (isset($this->bindings[$typeName])) {
            throw new \InvalidArgumentException("`$typeName` is already registerd.");
        }

        $type = new \ReflectionClass($typeName);
        $class = new \ReflectionClass($className);
        $this->bindings[$typeName] = new Service($type, $class);

        return $this;
    }
732689
private function _checkTypeNameFileNameMatch($typeName) {
		/* currentFilename holds file path - get basename */
		$fileBaseName = basename($this->_currentFilename);
		/*
		 * quick n dirty - append '.' to type name to ensure that we don't miss something like Foo1.php and Foo
		 */
		if ($this->_isActive('typeNameMatchesFileName') && !(substr($fileBaseName, 0, strlen($typeName) + 1) === $typeName . ".")) {
			$msg = $this->_getMessage('TYPE_FILE_NAME_MISMATCH', $typeName, $fileBaseName);
			$this->_writeError('typeNameMatchesFileName', $msg);
		}
	}
425721
public void registerType(String typeName, Class<?> clazz) {
        typeToName.put(typeName.toLowerCase(), clazz);
    }
300532
public function addType(Type $type, $name = '')
    {
        if (!$name) {
            $name = (string)$type;
        }

        $this->types[$name] = $type;
    }
633023
public static <T> T withFilePathOrClasspath(
            String resourceFilePathOrClasspath,
            TypeReference<T> typeReference) {
        return withJsonString(JMResources
                        .getStringWithFilePathOrClasspath(resourceFilePathOrClasspath),
                typeReference);
    }