You are here

interface FieldTypeExportInterface in Entity Export CSV 8

Defines an interface for Field type export plugins.

Hierarchy

Expanded class hierarchy of FieldTypeExportInterface

All classes that implement FieldTypeExportInterface

File

src/Plugin/FieldTypeExportInterface.php, line 14

Namespace

Drupal\entity_export_csv\Plugin
View source
interface FieldTypeExportInterface extends PluginInspectionInterface {

  /**
   * Build the configuration form.
   *
   * @param array $form
   *   The configuration form.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The form_state object.
   * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
   *   The field definition.
   *
   * @return mixed
   *   The configuration form.
   */
  public function buildConfigurationForm(array $form, FormStateInterface $form_state, FieldDefinitionInterface $field_definition);

  /**
   * Validates a configuration form for this plugin.
   *
   * @param array $form
   *   The form.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current form state.
   */
  public function validateConfigurationForm(array $form, FormStateInterface $form_state);

  /**
   * Retrieves the generator description.
   *
   * @return string
   *   The description of this generator.
   */
  public function getDescription();

  /**
   * Retrieves the label.
   *
   * @return string
   *   The label of this plugin.
   */
  public function getLabel();

  /**
   * Provides a human readable summary of the plugin's configuration.
   */
  public function summary();

  /**
   * Export the value of a field.
   *
   * @param \Drupal\Core\Entity\ContentEntityInterface $entity
   *   The entity to export.
   * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
   *   The field definition.
   * @param array $options
   *   An array of additionnal options.
   *
   * @return string
   *   The string value to be export in the CSV file.
   */
  public function export(ContentEntityInterface $entity, FieldDefinitionInterface $field_definition, array $options = []);

  /**
   * Gets the field's properties.
   *
   * @param \Drupal\Core\Field\FieldDefinitionInterface $definition
   *   The field definition.
   *
   * @return array|\Drupal\Core\TypedData\DataDefinitionInterface[]
   *   The field properties.
   */
  public function getFieldProperties(FieldDefinitionInterface $definition);

  /**
   * Massage the field item property value to CSV value.
   *
   * @param \Drupal\Core\Field\FieldItemInterface $field_item
   *   The field item.
   * @param string $property_name
   *   The property name.
   * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
   *   The field definition.
   * @param array $options
   *   An array of optional options.
   *
   * @return mixed
   *   The CSV value.
   */
  public function massageExportPropertyValue(FieldItemInterface $field_item, $property_name, FieldDefinitionInterface $field_definition, array $options = []);

  /**
   * Get the header columns for a field.
   *
   * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
   *   The field definition.
   *
   * @return array
   *   An array of header columns.
   */
  public function getHeaders(FieldDefinitionInterface $field_definition);

  /**
   * Get the columns to generate during the export.
   *
   * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
   *   The field definition.
   *
   * @return int
   *   The number of columns to generate.
   */
  public function getColumns(FieldDefinitionInterface $field_definition);

  /**
   * Get the header label for a field.
   *
   * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
   *   The field definition.
   *
   * @return string
   *   The header label.
   */
  public function getHeaderLabel(FieldDefinitionInterface $field_definition);

  /**
   * Import a value into a field.
   *
   * @param \Drupal\Core\Entity\ContentEntityInterface $entity
   *   The entity to export.
   * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
   *   The field definition.
   * @param string $property_name
   *   The field property to import.
   * @param array $options
   *   An array of additionnal options.
   *
   * @return string
   *   The string value to be export in the CSV file.
   */
  public function import(ContentEntityInterface $entity, FieldDefinitionInterface $field_definition, $property_name = '', array $options = []);

}

Members

Namesort descending Modifiers Type Description Overrides
FieldTypeExportInterface::buildConfigurationForm public function Build the configuration form. 1
FieldTypeExportInterface::export public function Export the value of a field. 1
FieldTypeExportInterface::getColumns public function Get the columns to generate during the export. 1
FieldTypeExportInterface::getDescription public function Retrieves the generator description. 1
FieldTypeExportInterface::getFieldProperties public function Gets the field's properties. 1
FieldTypeExportInterface::getHeaderLabel public function Get the header label for a field. 1
FieldTypeExportInterface::getHeaders public function Get the header columns for a field. 1
FieldTypeExportInterface::getLabel public function Retrieves the label. 1
FieldTypeExportInterface::import public function Import a value into a field. 1
FieldTypeExportInterface::massageExportPropertyValue public function Massage the field item property value to CSV value. 1
FieldTypeExportInterface::summary public function Provides a human readable summary of the plugin's configuration. 1
FieldTypeExportInterface::validateConfigurationForm public function Validates a configuration form for this plugin. 1
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2