private function getStringTypePrefix($length = null)
    {
        if ($length === null) {
            return 'LONG';
        }

        if (!is_int($length) || ($length <= 0)) {
            throw PlatformException::invalidStringTypePrefixLength();
        }

        $prefixLimits = array(
            'TINY'   => 255,
            ''       => 65535,
            'MEDIUM' => 16777215,
        );

        $stringTypePrefix = 'LONG';
        foreach ($prefixLimits as $prefix => $limit) {
            if ($length <= $limit) {
                $stringTypePrefix = $prefix;

                break;
            }
        }

        return $stringTypePrefix;
    }
private function getStringTypePrefix($length = null)
    {
        if ($length === null) {
            return 'LONG';
        }

        if (!is_int($length) || ($length <= 0)) {
            throw PlatformException::invalidStringTypePrefixLength();
        }

        $prefixLimits = array(
            'TINY'   => 255,
            ''       => 65535,
            'MEDIUM' => 16777215,
        );

        $stringTypePrefix = 'LONG';
        foreach ($prefixLimits as $prefix => $limit) {
            if ($length <= $limit) {
                $stringTypePrefix = $prefix;

                break;
            }
        }

        return $stringTypePrefix;
    }
private function getStringTypePrefix ( $ length = null ) { if ( $ length === null ) { return 'LONG' ; } if ( ! is_int ( $ length ) || ( $ length <= 0 ) ) { throw PlatformException :: invalidStringTypePrefixLength ( ) ; } $ prefixLimits = array ( 'TINY' => 255 , '' => 65535 , 'MEDIUM' => 16777215 , ) ; $ stringTypePrefix = 'LONG' ; foreach ( $ prefixLimits as $ prefix => $ limit ) { if ( $ length <= $ limit ) { $ stringTypePrefix = $ prefix ; break ; } } return $ stringTypePrefix ; }
Gets the string type prefix for the given length.

@link http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html String types length.

@param null|integer $length The length of the type.

@throws \Fridge\DBAL\Exception\PlatformException If the length is not a strict positive integer.

@return string The prefix.
Gets the string type prefix for the given length .