Doctrine\DBAL\DBALException::unknownColumnType PHP Method

unknownColumnType() public static method

public static unknownColumnType ( string $name ) : DBALException
$name string
return DBALException
    public static function unknownColumnType($name)
    {
        return new self('Unknown column type "' . $name . '" requested. Any Doctrine type that you use has ' . 'to be registered with \\Doctrine\\DBAL\\Types\\Type::addType(). You can get a list of all the ' . 'known types with \\Doctrine\\DBAL\\Types\\Type::getTypesMap(). If this error occurs during database ' . 'introspection then you might have forgotten to register all database types for a Doctrine Type. Use ' . 'AbstractPlatform#registerDoctrineTypeMapping() or have your custom types implement ' . 'Type#getMappedDatabaseTypes(). If the type name is empty you might ' . 'have a problem with the cache or forgot some mapping information.');
    }

Usage Example

Beispiel #1
0
 /**
  * Factory method to create type instances.
  * Type instances are implemented as flyweights.
  *
  * @param string $name The name of the type (as returned by getName()).
  *
  * @return \Doctrine\DBAL\Types\Type
  *
  * @throws \Doctrine\DBAL\DBALException
  */
 public static function getType($name)
 {
     if (!isset(self::$_typeObjects[$name])) {
         if (!isset(self::$_typesMap[$name])) {
             throw DBALException::unknownColumnType($name);
         }
         self::$_typeObjects[$name] = new self::$_typesMap[$name]();
     }
     return self::$_typeObjects[$name];
 }