You are here

interface TemplateInterface in Wysiwyg API template plugin 8.2

Same name and namespace in other branches
  1. 3.0.x modules/wysiwyg_template_core/src/TemplateInterface.php \Drupal\wysiwyg_template_core\TemplateInterface

Provides an interface for defining Template entities.

Hierarchy

Expanded class hierarchy of TemplateInterface

All classes that implement TemplateInterface

1 file declares its use of TemplateInterface
Template.php in src/Entity/Template.php

File

modules/wysiwyg_template_core/src/TemplateInterface.php, line 10

Namespace

Drupal\wysiwyg_template_core
View source
interface TemplateInterface {

  /**
   * Gets the template description.
   *
   * @return string
   *   The template description.
   */
  public function getDescription() : string;

  /**
   * Gets the template body.
   *
   * @return string
   *   The template HTML body.
   */
  public function getBody() : string;

  /**
   * Gets the text format.
   *
   * @return string
   *   The text format for the body.
   */
  public function getFormat() : string;

  /**
   * Gets the template weight.
   *
   * @return int
   *   The template weight.
   */
  public function getWeight() : int;

  /**
   * Gets the list of allowed node types.
   *
   * @return string[]
   */
  public function getNodeTypes() : array;

  /**
   * Loads templates filtered by node type.
   *
   * @param \Drupal\node\NodeTypeInterface $node_type
   *   (optional) The node type to filter by. If this is not passed, only
   *   templates that specify *no* types will be returned.
   *
   * @return \Drupal\wysiwyg_template_core\TemplateInterface[]
   *   The list of available templates filtered by node type.
   */
  public static function loadByNodeType(NodeTypeInterface $node_type = NULL) : array;

}

Members

Namesort descending Modifiers Type Description Overrides
TemplateInterface::getBody public function Gets the template body. 1
TemplateInterface::getDescription public function Gets the template description. 1
TemplateInterface::getFormat public function Gets the text format. 1
TemplateInterface::getNodeTypes public function Gets the list of allowed node types. 1
TemplateInterface::getWeight public function Gets the template weight. 1
TemplateInterface::loadByNodeType public static function Loads templates filtered by node type. 1