Returns a value suitable for the field id property.
@param  string $suffix Specify a suffix string
@return string
513646
public function getId($suffix = null)
    {
        $id = 'field';
        if ($this->arrayName) {
            $id .= '-'.$this->arrayName;
        }

        $id .= '-'.$this->fieldName;

        if ($suffix) {
            $id .= '-'.$suffix;
        }

        if ($this->idPrefix) {
            $id = $this->idPrefix . '-' . $id;
        }

        return HtmlHelper::nameToId($id);
    }
392637
public static function generateSuffixedIdentName( array $identNames, $suffix )
    {
        $ident = implode( "_", $identNames ) . "_" . $suffix;
        $i = 0;
        $last = -1;

        while ( strlen( $ident ) > self::IDENTIFIER_MAX_LENGTH )
        {
            if ( strlen( $identNames[$i] ) > 1 || $last == $i )
            {
                $identNames[$i] = substr( $identNames[$i], 0, strlen( $identNames[$i] ) - 1 );
                $last = $i;
            }
            $i = ( $i + 1 ) % count( $identNames );
            $ident = implode( "_", $identNames ) . "_" . $suffix;
        }
        return $ident;
    }
979685
def strip_suffix(id):
    
    suffix = get_suffix(id)
    if not suffix:
        return id
    return re.split(suffix, id)[0]
925502
public function resolveFilename($extension = null)
    {
        if ($extension === null) {
            $extension = $this->extension;
        }
        return $this->name . '-' . $this->id . '.' . $extension;
    }
347606
public static function addSuffix(string $value, string $suffix): string
    {
        return self::removeSuffix($value, $suffix).$suffix;
    }
202495
public function _input_id( $suffix = '' ) {
		return $this->field->id() . $suffix . ( $this->field->is_repeatable() ? '_' . $this->iterator : '' );
	}
357160
public function getPathByConvention($suffix = null)
    {
        if (empty($suffix)) {
            return sprintf('%s_nodes', $this->getBundleName());
        }

        return sprintf('%s_nodes_%s', $this->getBundleName(), $suffix);
    }
465452
public static function pluginClassQuestion($suffix = '') {
    $default_class = function ($vars) use ($suffix) {
      $unprefixed_plugin_id = preg_replace('/^' . $vars['machine_name'] . '_/', '', $vars['plugin_id']);
      return Utils::camelize($unprefixed_plugin_id) . $suffix;
    };
    return new Question('Plugin class', $default_class);
  }
104385
static public function suffixToContentType($suffix)
    {
        $types = self::bySuffix();
        return isset($types[$suffix]) ? $types[$suffix]['content-type'] : null;
    }
611759
public function getViewerTemplates($suffix = '')
    {
        $copy = $this->CopyContentFrom();
        if ($copy && $copy->exists()) {
            return $copy->getViewerTemplates($suffix);
        }

        return parent::getViewerTemplates($suffix);
    }
443445
function getSuffix( $where, $orderBy = array(), $limitCount = null, $limitOffset = null ) {

        $suffix = "";

        if ( !empty( $where ) ) {

            $suffix .= " WHERE " . implode( " AND ", $where );

        }

        if ( !empty( $orderBy ) ) {

            $suffix .= " ORDER BY " . implode( ", ", $orderBy );

        }

        if ( isset( $limitCount ) ) {

            $suffix .= " LIMIT " . intval( $limitCount );

            if ( isset( $limitOffset ) ) {

                $suffix .= " OFFSET " . intval( $limitOffset );

            }

        }

        return $suffix;

    }
1250261
private static function normalizeReservedKeywords(string $name, string $suffix): string
    {
        if (!\in_array(strtolower($name), self::$reservedKeywords, true)) {
            return $name;
        }

        return $name.$suffix;
    }
174026
public function getName( $suffix = NULL ) : string
    {
        $name = $suffix ? basename( $this->path, $suffix ) : basename( $this->path );

        return $name;
    }
841569
public function getFlexiData($suffix = null, $conditions = null)
    {
        $finalUrl          = '';
        $evidenceToRestore = null;
        $urlParams         = $this->defaultUrlParams;

        if (!empty($conditions)) {
            if (is_array($conditions)) {
                $this->extractUrlParams($conditions, $urlParams);
                if (array_key_exists('evidence', $conditions) && is_null($this->getColumnInfo('evidence'))) {
                    $evidenceToRestore = $this->getEvidence();
                    $this->setEvidence($conditions['evidence']);
                    unset($conditions['evidence']);
                }
                $conditions = $this->flexiUrl($conditions);
            }

            if (strlen($conditions) && ($conditions[0] != '/')) {
                $conditions = '('.self::urlEncode($conditions).')';
            }
        }

        if (strlen($suffix) && ($suffix != '$sum')) {
            if (preg_match('/^http/', $suffix) || ($suffix[0] == '/') || is_numeric($suffix)) {
                $finalUrl = $suffix;
            } else {
                if (preg_match('/^(code|ext):(.*)/', $suffix)) {
                    $finalUrl = self::urlizeId($suffix);
                } else {
                    $finalUrl = $suffix;
                }
            }
        }

        $finalUrl .= $conditions;

        if ($suffix == '$sum') {
            $finalUrl .= '/$sum';
        }

        if (!empty($urlParams)) {
            if (strstr($finalUrl, '?')) {
                $finalUrl .= '&';
            } else {
                $finalUrl .= '?';
            }

            $finalUrl .= http_build_query(array_map(function($a) {
                return is_bool($a) ? ($a ? 'true' : 'false' ) : $a;
            }, $urlParams),
                null, '&', PHP_QUERY_RFC3986);
        }

        $transactions     = $this->performRequest($finalUrl, 'GET');
        $responseEvidence = $this->getResponseEvidence();
        if (is_array($transactions) && array_key_exists($responseEvidence,
                $transactions)) {
            $result = $transactions[$responseEvidence];
            if ((count($result) == 1) && (count(current($result)) == 0 )) {
                $result = null; // Response is empty Array
            }
        } else {
            $result = $transactions;
        }
        if (!is_null($evidenceToRestore)) {
            $this->setEvidence($evidenceToRestore);
        }
        return $result;
    }
840959
private function getPrefixAndSid($id)
    {
        if (count($parts = explode('.', $id)) < 2) {
            return array(null, $id);
        }

        $sid    = array_pop($parts);
        $prefix = implode('.', $parts);

        return array($prefix, $sid);
    }
852653
public static function getClassShortNameUnderscored(
        string $class,
        string $suffix = ''
    ): string {
        $classShortName = static::getClassShortName($class, $suffix);

        return StringUtils::underscore($classShortName);
    }
743564
static function getFileName( $prefix = 'Language', $code, $suffix = '.php' ) {
		// Protect against path traversal
		if ( !Language::isValidCode( $code )
			|| strcspn( $code, ":/\\\000" ) !== strlen( $code ) )
		{
			throw new MWException( "Invalid language code \"$code\"" );
		}

		return $prefix . str_replace( '-', '_', ucfirst( $code ) ) . $suffix;
	}