You are here

public function Mapping::getFormattedContentType in GatherContent 8.5

Same name and namespace in other branches
  1. 8.3 src/Entity/Mapping.php \Drupal\gathercontent\Entity\Mapping::getFormattedContentType()
  2. 8.4 src/Entity/Mapping.php \Drupal\gathercontent\Entity\Mapping::getFormattedContentType()

Formatter for content type property.

Return value

string If not empty return human name for content type, else return None string.

Overrides MappingInterface::getFormattedContentType

File

src/Entity/Mapping.php, line 250

Class

Mapping
Defines the GatherContent Mapping entity.

Namespace

Drupal\gathercontent\Entity

Code

public function getFormattedContentType() {
  $content_type = $this
    ->get('content_type_name');
  if (!empty($content_type)) {
    return $content_type;
  }
  else {
    return $this
      ->t('None');
  }
}