You are here

interface BlazyFormatterInterface in Blazy 8.2

Same name and namespace in other branches
  1. 7 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 Drupal\Core\Field\FieldItemListInterface items.
   */
  public function buildSettings(array &$build, $items);

  /**
   * 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 array $entities
   *   The optional entities array, not available for non-entities: text, image.
   */
  public function preBuildElements(array &$build, $items, 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 array $entities
   *   The optional entities array, not available for non-entities: text, image.
   */
  public function postBuildElements(array &$build, $items, 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);

  /**
   * Checks if an image style contains crop effect.
   *
   * @param string $style
   *   The image style to check for.
   *
   * @return object|bool
   *   Returns the image style instance if it contains crop effect, else FALSE.
   */
  public function isCrop($style);

}

Members

Namesort descending Modifiers Type Description Overrides
BlazyFormatterInterface::buildSettings public function Modifies the field formatter settings inherited by child elements. 1
BlazyFormatterInterface::extractFirstItem public function Extract the first image item to build colorbox/zoom-like gallery. 1
BlazyFormatterInterface::isCrop public function Checks if an image style contains crop effect. 1
BlazyFormatterInterface::postBuildElements public function Modifies the field formatter settings not inherited by child elements. 1
BlazyFormatterInterface::preBuildElements public function Modifies the field formatter settings inherited by child elements. 1
BlazyManagerInterface::attach public function Returns array of needed assets suitable for #attached property. 1
BlazyManagerInterface::getImageEffects public function Returns the supported image effects. 1
BlazyManagerInterface::getIoSettings public function Returns drupalSettings for IO. 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