You are here

interface StorageManagerInterface in Paragraph View Mode 8

Same name and namespace in other branches
  1. 2.x src/StorageManagerInterface.php \Drupal\paragraph_view_mode\StorageManagerInterface

Provides an interface for managing the storage.

@package Drupal\paragraph_view_mode

Hierarchy

Expanded class hierarchy of StorageManagerInterface

All classes that implement StorageManagerInterface

2 files declare their use of StorageManagerInterface
ParagraphViewModeWidget.php in src/Plugin/Field/FieldWidget/ParagraphViewModeWidget.php
paragraph_view_mode.module in ./paragraph_view_mode.module
Contains paragraphs_view_mode.module functions.

File

src/StorageManagerInterface.php, line 10

Namespace

Drupal\paragraph_view_mode
View source
interface StorageManagerInterface {

  /**
   * Entity type name.
   */
  const ENTITY_TYPE = 'paragraph';

  /**
   * Module configuration name.
   */
  const CONFIG_NAME = 'paragraph_view_mode';

  /**
   * View mode field name.
   */
  const FIELD_NAME = SELF::CONFIG_NAME;

  /**
   * View mode field type.
   */
  const FIELD_TYPE = SELF::FIELD_NAME;

  /**
   * View mode field label.
   */
  const FIELD_LABEL = 'Paragraph view mode';

  /**
   * Add field to the given bundle.
   *
   * @param string $bundle
   *   Paragraph entity bundle.
   *
   * @return bool
   *   True if the field exist or was created successfully.
   */
  public function addField(string $bundle) : bool;

  /**
   * Delete field from the given bundle.
   *
   * @param string $bundle
   *   Paragraph entity bundle.
   *
   * @return bool
   *   True if the field does not exist or was successfully deleted.
   */
  public function deleteField(string $bundle) : bool;

  /**
   * Sets field label.
   *
   * @param string $bundle
   *   Paragraph entity bundle.
   *
   * @param string $label
   *   Label.
   *
   * @throws \Drupal\Core\Entity\EntityStorageException
   */
  public function setFieldLabel(string $bundle, string $label) : void;

  /**
   * Add paragraph view mode field to paragraph entity form display.
   *
   * @param string $bundle
   *   Paragraph entity bundle.
   * @param string $form_mode
   *   Form mode machine name.
   */
  public function addToFormDisplay(string $bundle, string $form_mode = 'default') : void;

}

Members

Namesort descending Modifiers Type Description Overrides
StorageManagerInterface::addField public function Add field to the given bundle. 1
StorageManagerInterface::addToFormDisplay public function Add paragraph view mode field to paragraph entity form display. 1
StorageManagerInterface::CONFIG_NAME constant Module configuration name.
StorageManagerInterface::deleteField public function Delete field from the given bundle. 1
StorageManagerInterface::ENTITY_TYPE constant Entity type name.
StorageManagerInterface::FIELD_LABEL constant View mode field label.
StorageManagerInterface::FIELD_NAME constant View mode field name.
StorageManagerInterface::FIELD_TYPE constant View mode field type.
StorageManagerInterface::setFieldLabel public function Sets field label. 1