public static function exists($typeName)
    {
        $db = static::getDb();

        return $db->createCommand(
            'SELECT EXISTS ('
            . 'SELECT 1 '
                . 'FROM ' . $db->quoteTableName('pg_type')
                . ' WHERE typname = ' . $db->quoteValue($typeName)
            . ')'
        )->queryScalar();
    }
public static function exists($typeName)
    {
        $db = static::getDb();

        return $db->createCommand(
            'SELECT EXISTS ('
            . 'SELECT 1 '
                . 'FROM ' . $db->quoteTableName('pg_type')
                . ' WHERE typname = ' . $db->quoteValue($typeName)
            . ')'
        )->queryScalar();
    }
public static function exists ( $ typeName ) { $ db = static :: getDb ( ) ; return $ db -> createCommand ( 'SELECT EXISTS (' . 'SELECT 1 ' . 'FROM ' . $ db -> quoteTableName ( 'pg_type' ) . ' WHERE typname = ' . $ db -> quoteValue ( $ typeName ) . ')' ) -> queryScalar ( ) ; }
Check if an enum type exists

@param string $typeName name of the enum type
@return bool true if exists
Check if an enum type exists