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