You are here

public function Template::getFormat in Wysiwyg API template plugin 8.2

Same name and namespace in other branches
  1. 3.0.x src/Entity/Template.php \Drupal\wysiwyg_template\Entity\Template::getFormat()

Gets the text format.

Return value

string The text format for the body.

Overrides TemplateInterface::getFormat

File

src/Entity/Template.php, line 104

Class

Template
Defines the Template entity.

Namespace

Drupal\wysiwyg_template\Entity

Code

public function getFormat() : string {
  if ($body = $this
    ->get('body')) {
    return $body['format'];
  }
  return '';
}