public function resolveNamePattern( $limit = 0, $sequence = '' )
    {
        // Fetch attributes for present identifiers
        $this->fetchContentAttributes();

        // Replace tokens with real values
        $objectName = $this->translatePattern();

        $db = eZDB::instance();

        $limit = $limit ?: self::FIELD_NAME_MAX_SIZE;

        if ( $db->countStringSize( $objectName ) <= $limit )
        {
            return $objectName;
        }

        return preg_replace(
            "/[\pZ\pC]+$/u",
            '',
            $db->truncateString( $objectName, $limit, 'name', $sequence )
        ). $sequence;
    }