You are here

interface EditableFieldsHelperInterface in Editable Fields 1.0.x

Same name and namespace in other branches
  1. 8 src/services/EditableFieldsHelperInterface.php \Drupal\editablefields\services\EditableFieldsHelperInterface

Interface EditableFieldsHelperInterface.

Hierarchy

Expanded class hierarchy of EditableFieldsHelperInterface

All classes that implement EditableFieldsHelperInterface

1 file declares its use of EditableFieldsHelperInterface
EditableFieldsFieldFormatter.php in src/Plugin/Field/FieldFormatter/EditableFieldsFieldFormatter.php

File

src/services/EditableFieldsHelperInterface.php, line 10

Namespace

Drupal\editablefields\services
View source
interface EditableFieldsHelperInterface {

  /**
   * Editablefields formatter ID.
   */
  const FORMATTER_ID = 'editablefields_formatter';

  /**
   * Use "editablefields" permission.
   */
  const PERMISSION = 'use editablefields';

  /**
   * Editablefields admin permission.
   */
  const ADMIN_PERMISSION = 'administer editablefields';

  /**
   * Editablefields form class.
   */
  const FORM_CLASS = 'Drupal\\editablefields\\Form\\EditableFieldsForm';

  /**
   * Default form mode.
   */
  const DEFAULT_FORM_MODE = 'default';

  /**
   * Make "editablefields" formatter available for all the field types.
   *
   * @param array $info
   *   An array of information on existing formatter types, as collected by the
   *   annotation discovery mechanism.
   */
  public function formatterInfoAlter(array &$info);

  /**
   * Get machine names of all the field types.
   *
   * @return array
   *   Array of all field types machine names.
   */
  public function getAllFieldTypes();

  /**
   * Checks if the user can use "editablefields" formatter.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   Entity object.
   *
   * @return bool
   *   TRUE if the user can use "editablefields" formatret.
   */
  public function checkAccess(EntityInterface $entity);

  /**
   * Check if the user has administer permission.
   *
   * @return bool
   *   TRUE if the user has administer permission.
   */
  public function isAdmin();

  /**
   * Prepares a render array of the editable field form.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   Entity object.
   * @param string $field_name
   *   Field name.
   * @param string $form_mode
   *   Form mode.
   *
   * @return array
   *   Form render array.
   */
  public function getForm(EntityInterface $entity, string $field_name, string $form_mode);

  /**
   * Loads entity form display.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   Entity object.
   * @param $form_mode
   *   Form mode.
   *
   * @return \Drupal\Core\Entity\Display\EntityFormDisplayInterface|NULL
   */
  public function getFormDisplay(EntityInterface $entity, $form_mode);

  /**
   * Helper method to prepare the list of the form modes.
   *
   * @return array
   *   Array of form modes.
   */
  public function getModesOptions();

}

Members

Namesort descending Modifiers Type Description Overrides
EditableFieldsHelperInterface::ADMIN_PERMISSION constant Editablefields admin permission.
EditableFieldsHelperInterface::checkAccess public function Checks if the user can use "editablefields" formatter. 1
EditableFieldsHelperInterface::DEFAULT_FORM_MODE constant Default form mode.
EditableFieldsHelperInterface::formatterInfoAlter public function Make "editablefields" formatter available for all the field types. 1
EditableFieldsHelperInterface::FORMATTER_ID constant Editablefields formatter ID.
EditableFieldsHelperInterface::FORM_CLASS constant Editablefields form class.
EditableFieldsHelperInterface::getAllFieldTypes public function Get machine names of all the field types. 1
EditableFieldsHelperInterface::getForm public function Prepares a render array of the editable field form. 1
EditableFieldsHelperInterface::getFormDisplay public function Loads entity form display. 1
EditableFieldsHelperInterface::getModesOptions public function Helper method to prepare the list of the form modes. 1
EditableFieldsHelperInterface::isAdmin public function Check if the user has administer permission. 1
EditableFieldsHelperInterface::PERMISSION constant Use "editablefields" permission.