Doctrine\DBAL\DBALException::typeExists PHP Method

typeExists() public static method

public static typeExists ( string $name ) : DBALException
$name string
return DBALException
    public static function typeExists($name)
    {
        return new self('Type ' . $name . ' already exists.');
    }

Usage Example

Esempio n. 1
0
 /**
  * Adds a custom type to the type map.
  *
  * @param string $name      The name of the type. This should correspond to what getName() returns.
  * @param string $className The class name of the custom type.
  *
  * @return void
  *
  * @throws \Doctrine\DBAL\DBALException
  */
 public static function addType($name, $className)
 {
     if (isset(self::$_typesMap[$name])) {
         throw DBALException::typeExists($name);
     }
     self::$_typesMap[$name] = $className;
 }