Retrieves a custom type definition by name, that will be used to proxy the property's validation to.

@param string $type The name/key of the type prefixed with a '&'.

@return SchemaInterface
484502
protected function getCustomType($type)
    {
        $root = $this;
        while ($cur = $root->getParent()) {
            $root = $cur;
        }
        $customTypes = $root->getSchema()->getCustomTypes();
        $type = ltrim($type, '&');

        if (isset($customTypes[$type])) {
            return $customTypes[$type];
        }

        throw new Exception("Unable to resolve '$type' to a custom type-definition.");
    }
828109
public static function checkSchemaType($type)
    {
        if (isset(self::$_schemaTypes[$type])) {
            return self::$_schemaTypes[$type];
        } else {
            return false;
        }
    }
835145
public function setType($type)
    {
        foreach ($this->results as $name) {
            $this->columns->offsetGet($name)->setType($type);
        }

        return $this;
    }
1074645
protected function getResultsByType($type)
    {
        $instance = $this->createModelByType($type);

        $ownerKey = $this->ownerKey ?? $instance->getKeyName();

        $query = $this->replayMacros($instance->newQuery())
                            ->mergeConstraintsFrom($this->getQuery())
                            ->with($this->getQuery()->getEagerLoads());

        return $query->whereIn(
            $instance->getTable().'.'.$ownerKey, $this->gatherKeysByType($type)
        )->get();
    }
433369
protected function getCastToDefinition($type)
    {
        // Custom definitions.
        if (array_has(static::$cast_to, $type)) {
            return array_get(static::$cast_to, $type);
        }

        // Fallback to default.
        if (array_has(static::$default_cast_to, $type)) {
            return array_get(static::$default_cast_to, $type);
        }

        return false;
    }
164718
public function getColumn(string $name): AbstractColumn
    {
        if (!$this->schema->hasColumn($name)) {
            throw new DefinitionException("Undefined column {$name} in {$this->schema->getName()}");
        }

        return clone $this->schema->column($name);
    }
178904
public function &get($type, $name)
    {
        if ($this->_initialized) {
            $type = strtolower($type);
            if (false == key_exists($type, $this->types)) {
                return PEAR::raiseError("No such type $type");
            }

            $name     = strtolower($name);
            $type_var = &$this->{'_' . $this->types[$type]};

            if (key_exists($name, $type_var)) {
                return $type_var[$name];
            } elseif (key_exists($name, $this->_oids) && $this->_oids[$name]['type'] == $type) {
                return $this->_oids[$name];
            } else {
                return PEAR::raiseError("Could not find $type $name");
            }
        } else {
            $return = null;
            return $return;
        }
    }
48624
private function parseCastToValidator($type)
    {
        if (array_has(static::$cast_validation, $type)) {
            return array_get(static::$cast_validation, $type);
        }

        if (array_has(static::$default_cast_validation, $type)) {
            return array_get(static::$default_cast_validation, $type);
        }

        return $type;
    }
91287
protected function getGenerator($type)
    {
        switch ($type) {
            case "controller":
                return new ControllerGenerator($this);

            case "model":
                return new ModelGenerator($this);

            case "customposttype":
                return new CustomPostTypeGenerator($this);

            case "viewhelper" :
            case "helper":
                return new HelperGenerator($this);

            case "taxonomy":
                return new TaxonomyGenerator($this);

            case "validator":
                return new ValidatorGenerator($this);

            case "command":
                return new CommandGenerator($this);
        }

        throw new InvalidArgumentException("That is not a valid command.");
    }
146932
public static function toDoctrineTypeName($type)
    {
        $typeMap = self::getDoctrineTypeMap();

        if (!array_key_exists($type, $typeMap)) {
            throw new SystemException(sprintf('Unknown column type: %s', $type));
        }

        return $typeMap[$type];
    }
568607
final public function getPropertyType($name) {

		if (in_array($name, ['db', 'loadedFromDb', 'typeList', 'errors'])) {
			$type = NULL;
		} else if (array_key_exists($name, $this->typeList)) {
			$type = $this->typeList[$name];
		} else {
			$type = 'string';
		}

		return $type;
	
	}
934309
public static function get($name)
    {
        if (!isset(static::$types[$name])) {
            if (!static::has($name)) {
                throw new \InvalidArgumentException(sprintf('The type "%s" does not exists.', $name));
            }

            static::$types[$name] = new static::$map[$name];
        }

        return static::$types[$name];
    }
141258
private static function getMappedType($type)
    {
        if (!isset(self::$mappedTypes[$type])) {
            throw MysqliException::mappedTypeDoesNotExist($type);
        }

        return self::$mappedTypes[$type];
    }
944236
public function getTypeName($type)
    {
        $allowedTypes = $this->getAllowedTypes();

        if ($type && isset($allowedTypes[$type])) {
            return $allowedTypes[$type];
        }

        return t("None"); // @todo
    }
1122222
private static function getClass($type)
    {
        if (!\array_key_exists($type, self::$types)) {
            throw new \RuntimeException('invalid type');
        }

        return self::$types[$type];
    }
635612
public function getType($name)
    {
        if (false === $this->hasType($name)) {
            throw new InvalidArgumentException(sprintf('The type "%s" was not found.', $name));
        }
        if (isset($this->loaded[$name])) {
            return $this->loaded[$name];
        }
        $fqcn = $this->types[$name];
        $type = new $fqcn;

        if (!$type instanceof TypeInterface) {
            throw new InvalidArgumentException(sprintf('The class "%s" must implement the "%s\\Types\TypeInterface"', $fqcn, __NAMESPACE__));
        }

        return $this->loaded[$name] = new $fqcn;
    }
987373
public function setSchemaFormat($type)
    {
        if (!defined('\LdapTools\Factory\SchemaParserFactory::TYPE_'.strtoupper($type))) {
            throw new ConfigurationException(sprintf('Unknown schema format "%s".', $type));
        }
        $this->config['schemaFormat'] = $type;

        return $this;
    }