You are here

protected static function GeneralEntityReferenceFormatter::getEntityReferenceStyles in Formatter Suite 8

Returns an array of formatting styles.

Return value

string[] Returns an associative array with internal names as keys and human-readable translated names as values.

3 calls to GeneralEntityReferenceFormatter::getEntityReferenceStyles()
GeneralEntityReferenceFormatter::sanitizeSettings in src/Plugin/Field/FieldFormatter/GeneralEntityReferenceFormatter.php
Sanitize settings to insure that they are safe and valid.
GeneralEntityReferenceFormatter::settingsForm in src/Plugin/Field/FieldFormatter/GeneralEntityReferenceFormatter.php
Returns a form to configure settings for the formatter.
GeneralEntityReferenceFormatter::settingsSummary in src/Plugin/Field/FieldFormatter/GeneralEntityReferenceFormatter.php
Returns a short summary for the current formatter settings.

File

src/Plugin/Field/FieldFormatter/GeneralEntityReferenceFormatter.php, line 172

Class

GeneralEntityReferenceFormatter
Formats an entity reference as one or more links.

Namespace

Drupal\formatter_suite\Plugin\Field\FieldFormatter

Code

protected static function getEntityReferenceStyles() {

  // Some of these have special case code below so that they work
  // well for msot entity types.
  return [
    'id' => t("Entity's ID"),
    'title' => t("Entity's title"),
    'title-id' => t("Entity's title and ID"),
    'title-author' => t("Entity's title and author"),
    'title-created' => t("Entity's title and creation date"),
    'title-changed' => t("Entity's title and update date"),
    'custom' => t('Custom'),
  ];
}