You are here

interface FieldDiffBuilderInterface in Diff 8

Builds a diff from field item list.

Hierarchy

Expanded class hierarchy of FieldDiffBuilderInterface

All classes that implement FieldDiffBuilderInterface

File

src/FieldDiffBuilderInterface.php, line 13

Namespace

Drupal\diff
View source
interface FieldDiffBuilderInterface extends PluginFormInterface, ConfigurableInterface {

  /**
   * Builds an array of strings.
   *
   * This method is responsible for transforming a FieldItemListInterface object
   * into an array of strings. The resulted array of strings is then compared by
   * the Diff component with another such array of strings and the result
   * represents the difference between two entity fields.
   *
   * Example of FieldItemListInterface built into an array of strings:
   * @code
   * array(
   *   0 => "This is an example string",
   *   1 => "Field values or properties",
   * )
   * @endcode
   *
   * @see \Drupal\diff\Plugin\diff\Field\TextFieldBuilder
   *
   * @param FieldItemListInterface $field_items
   *   Represents an entity field.
   *
   * @return mixed
   *   An array of strings to be compared. If an empty array is returned it
   *   means that a field is either empty or no properties need to be compared
   *   for that field.
   */
  public function build(FieldItemListInterface $field_items);

  /**
   * Returns if the plugin can be used for the provided field.
   *
   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $field_definition
   *   The field definition that should be checked.
   *
   * @return bool
   *   TRUE if the plugin can be used, FALSE otherwise.
   */
  public static function isApplicable(FieldStorageDefinitionInterface $field_definition);

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigurableInterface::defaultConfiguration public function Gets default configuration for this plugin. 11
ConfigurableInterface::getConfiguration public function Gets this plugin's configuration. 12
ConfigurableInterface::setConfiguration public function Sets the configuration for this plugin instance. 12
FieldDiffBuilderInterface::build public function Builds an array of strings. 11
FieldDiffBuilderInterface::isApplicable public static function Returns if the plugin can be used for the provided field. 1
PluginFormInterface::buildConfigurationForm public function Form constructor. 36
PluginFormInterface::submitConfigurationForm public function Form submission handler. 32
PluginFormInterface::validateConfigurationForm public function Form validation handler. 18