You are here

interface BlazyManagerInterface in Blazy 7

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

Defines re-usable services and functions for blazy plugins.

Hierarchy

Expanded class hierarchy of BlazyManagerInterface

All classes that implement BlazyManagerInterface

6 files declare their use of BlazyManagerInterface
BlazyAdminBase.php in src/Form/BlazyAdminBase.php
BlazyFilter.php in src/Plugin/Filter/BlazyFilter.php
BlazyFormatterBlazy.php in src/Plugin/Field/FieldFormatter/BlazyFormatterBlazy.php
BlazySettingsForm.php in modules/blazy_ui/src/Form/BlazySettingsForm.php
BlazyTextFormatter.php in src/Plugin/Field/FieldFormatter/BlazyTextFormatter.php

... See full list

File

src/BlazyManagerInterface.php, line 8

Namespace

Drupal\blazy
View source
interface BlazyManagerInterface {

  /**
   * Returns array of needed assets suitable for #attached property.
   *
   * @return array
   *   Returns the required library array.
   */
  public function attach(array $attach);

  /**
   * Typecast the needed settings, blazy-related module can override.
   *
   * Performance wise, typecasting should be at the form submit as calling
   * self::config() can be called multiple times. See sample below.
   *
   * @see Drupal\blazy_ui\Form\BlazySettingsForm::submitForm()
   * @see Drupal\slick_ui\Form\SlickSettingsForm::submitForm()
   */
  public function typecast(array &$config, $id = 'blazy.settings');

  /**
   * Gets the supported lightboxes.
   *
   * @return array
   *   The supported lightboxes.
   */
  public function getLightboxes();

  /**
   * Checks for Blazy formatter such as from within a Views style plugin.
   *
   * Ensures the settings traverse up to the container where Blazy is clueless.
   * The supported plugins can add [data-blazy] attribute into its container
   * containing $settings['blazy_data'] converted into [data-blazy] JSON.
   * This allows Blazy Grid, or other Views styles, lacking of UI, to have
   * additional settings extracted from the first Blazy formatter found.
   * Such as media switch/ lightbox. This way the container can add relevant
   * attributes to its container, etc. Also applies to entity references where
   * Blazy is not the main formatter, instead embedded as part of the parent's.
   *
   * @param array $settings
   *   The settings being modified.
   * @param array $item
   *   The item containing settings or item keys, not image item.
   */
  public function isBlazy(array &$settings, array $item = []);

}

Members

Namesort descending Modifiers Type Description Overrides
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