You are here

interface BlazyFormatterInterface in Blazy 7

Same name and namespace in other branches
  1. 8.2 src/BlazyFormatterInterface.php \Drupal\blazy\BlazyFormatterInterface

Defines common field formatter-related methods: Blazy, Slick.

Hierarchy

Expanded class hierarchy of BlazyFormatterInterface

All classes that implement BlazyFormatterInterface

File

src/BlazyFormatterInterface.php, line 8

Namespace

Drupal\blazy
View source
interface BlazyFormatterInterface extends BlazyManagerInterface {

  /**
   * Modifies the field formatter settings inherited by child elements.
   *
   * @param array $build
   *   The array containing: settings, or potential optionset for extensions.
   * @param object $items
   *   The items to prepare settings for.
   * @param object $entity
   *   The entity this field belongs to.
   */
  public function buildSettings(array &$build, $items, $entity);

  /**
   * Modifies the field formatter settings inherited by child elements.
   *
   * @param array $build
   *   The array containing: settings, or potential optionset for extensions.
   * @param object $items
   *   The Drupal\Core\Field\FieldItemListInterface items.
   * @param object $entity
   *   The entity this field belongs to.
   * @param array $entities
   *   The optional entities array, not available for non-entities: text, image.
   */
  public function preBuildElements(array &$build, $items, $entity, array $entities = []);

  /**
   * Modifies the field formatter settings not inherited by child elements.
   *
   * @param array $build
   *   The array containing: items, settings, or a potential optionset.
   * @param object $items
   *   The Drupal\Core\Field\FieldItemListInterface items.
   * @param object $entity
   *   The entity this field belongs to.
   * @param array $entities
   *   The optional entities array, not available for non-entities: text, image.
   */
  public function postBuildElements(array &$build, $items, $entity, array $entities = []);

  /**
   * Extract the first image item to build colorbox/zoom-like gallery.
   *
   * @param array $settings
   *   The $settings array being modified.
   * @param object $item
   *   The Drupal\image\Plugin\Field\FieldType\ImageItem item.
   * @param object $entity
   *   The optional media entity.
   */
  public function extractFirstItem(array &$settings, $item, $entity = NULL);

}

Members

Namesort descending Modifiers Type Description Overrides
BlazyFormatterInterface::buildSettings public function Modifies the field formatter settings inherited by child elements.
BlazyFormatterInterface::extractFirstItem public function Extract the first image item to build colorbox/zoom-like gallery.
BlazyFormatterInterface::postBuildElements public function Modifies the field formatter settings not inherited by child elements.
BlazyFormatterInterface::preBuildElements public function Modifies the field formatter settings inherited by child elements.
BlazyManagerInterface::attach public function Returns array of needed assets suitable for #attached property. 1
BlazyManagerInterface::getLightboxes public function Gets the supported lightboxes. 1
BlazyManagerInterface::isBlazy public function Checks for Blazy formatter such as from within a Views style plugin. 1
BlazyManagerInterface::typecast public function Typecast the needed settings, blazy-related module can override. 1