You are here

interface DsFieldInterface in Display Suite 8.3

Same name and namespace in other branches
  1. 8.4 src/Plugin/DsField/DsFieldInterface.php \Drupal\ds\Plugin\DsField\DsFieldInterface
  2. 8.2 src/Plugin/DsField/DsFieldInterface.php \Drupal\ds\Plugin\DsField\DsFieldInterface

Defines a common interface for all ds field plugins.

Hierarchy

Expanded class hierarchy of DsFieldInterface

All classes that implement DsFieldInterface

1 file declares its use of DsFieldInterface
field_ui.inc in includes/field_ui.inc
Field UI functions for Display Suite.

File

src/Plugin/DsField/DsFieldInterface.php, line 11

Namespace

Drupal\ds\Plugin\DsField
View source
interface DsFieldInterface extends ContainerFactoryPluginInterface {

  /**
   * Renders a field.
   *
   * @return array
   *   A renderable array representing the content of the field.
   */
  public function build();

  /**
   * Returns the summary of the chosen settings.
   *
   * @param array $settings
   *   Contains the settings of the field.
   *
   * @return array
   *   A render array containing the summary.
   */
  public function settingsSummary($settings);

  /**
   * The form that holds the settings for this plugin.
   *
   * @param array $form
   *   The form definition array for the field configuration form.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current state of the form.
   *
   * @return array
   *   The renderable form array representing the entire configuration form.
   */
  public function settingsForm($form, FormStateInterface $form_state);

  /**
   * Returns a list of possible formatters for this field.
   *
   * @return array
   *   A list of possible formatters.
   */
  public function formatters();

  /**
   * Returns if the field is allowed on the field UI screen.
   *
   * @return bool
   *   TRUE when field allowed, FALSE otherwise.
   */
  public function isAllowed();

  /**
   * Gets the current entity.
   *
   * @return \Drupal\Core\Entity\EntityInterface
   *   The current entity.
   */
  public function entity();

  /**
   * Gets the current entity type.
   *
   * @return string
   *   The entity type ID.
   */
  public function getEntityTypeId();

  /**
   * Gets the current bundle.
   *
   * @return string
   *   The configured bundle of the entity.
   */
  public function bundle();

  /**
   * Gets the view mode.
   *
   * @return string
   *   The configured view mode.
   */
  public function viewMode();

  /**
   * Gets the field configuration.
   *
   * @return array
   *   The configured field settings.
   */
  public function getFieldConfiguration();

  /**
   * Gets the field name.
   *
   * @return string
   *   The field name.
   */
  public function getName();

  /**
   * Returns the title of the field.
   *
   * @return string
   *   The configured field title.
   */
  public function getTitle();

  /**
   * Defines if we are dealing with a multivalue field.
   *
   * @return bool
   *   TRUE when field has multiple values, FALSE otherwise.
   */
  public function isMultiple();

}

Members

Namesort descending Modifiers Type Description Overrides
ContainerFactoryPluginInterface::create public static function Creates an instance of the plugin. 112
DsFieldInterface::build public function Renders a field. 1
DsFieldInterface::bundle public function Gets the current bundle. 1
DsFieldInterface::entity public function Gets the current entity. 1
DsFieldInterface::formatters public function Returns a list of possible formatters for this field. 1
DsFieldInterface::getEntityTypeId public function Gets the current entity type. 1
DsFieldInterface::getFieldConfiguration public function Gets the field configuration. 1
DsFieldInterface::getName public function Gets the field name. 1
DsFieldInterface::getTitle public function Returns the title of the field. 1
DsFieldInterface::isAllowed public function Returns if the field is allowed on the field UI screen. 1
DsFieldInterface::isMultiple public function Defines if we are dealing with a multivalue field. 1
DsFieldInterface::settingsForm public function The form that holds the settings for this plugin. 1
DsFieldInterface::settingsSummary public function Returns the summary of the chosen settings. 1
DsFieldInterface::viewMode public function Gets the view mode. 1