protected function truncateIdentifier($identifier, $lengthLimit = null, $hashSource = null)
    {
        if ($lengthLimit === null) {
            $lengthLimit = $this->getMaxIdentifierLength();
        }
        if (strlen($identifier) > $lengthLimit) {
            $identifier = substr($identifier, 0, $lengthLimit - 6) . '_' . substr(sha1($hashSource !== null ? $hashSource : $identifier), 0, 5);
        }

        return $identifier;
    }
protected function truncateIdentifier($identifier, $lengthLimit = null, $hashSource = null)
    {
        if ($lengthLimit === null) {
            $lengthLimit = $this->getMaxIdentifierLength();
        }
        if (strlen($identifier) > $lengthLimit) {
            $identifier = substr($identifier, 0, $lengthLimit - 6) . '_' . substr(sha1($hashSource !== null ? $hashSource : $identifier), 0, 5);
        }

        return $identifier;
    }
protected function truncateIdentifier ( $ identifier , $ lengthLimit = null , $ hashSource = null ) { if ( $ lengthLimit === null ) { $ lengthLimit = $ this -> getMaxIdentifierLength ( ) ; } if ( strlen ( $ identifier ) > $ lengthLimit ) { $ identifier = substr ( $ identifier , 0 , $ lengthLimit - 6 ) . '_' . substr ( sha1 ( $ hashSource !== null ? $ hashSource : $ identifier ) , 0 , 5 ) ; } return $ identifier ; }
Truncate an identifier if needed and append a hash to ensure uniqueness.

@param string $identifier
@param integer $lengthLimit
@param string $hashSource
@return string
Truncate an identifier if needed and append a hash to ensure uniqueness .