You are here

interface BlazyEntityInterface in Blazy 8.2

Same name and namespace in other branches
  1. 7 src/BlazyEntityInterface.php \Drupal\blazy\BlazyEntityInterface

Provides common entity utilities to work with field details.

This is alternative to Drupal\blazy\BlazyFormatter used outside field managers, such as Views field, or Slick/Entity Browser displays, etc.

Hierarchy

Expanded class hierarchy of BlazyEntityInterface

All classes that implement BlazyEntityInterface

See also

Drupal\blazy\Dejavu\BlazyEntityReferenceBase

Drupal\blazy\Plugin\Field\FieldFormatter\BlazyMediaFormatterBase

1 file declares its use of BlazyEntityInterface
BlazyViewsFieldPluginBase.php in src/Plugin/views/field/BlazyViewsFieldPluginBase.php

File

src/BlazyEntityInterface.php, line 14

Namespace

Drupal\blazy
View source
interface BlazyEntityInterface {

  /**
   * Build image/video preview either using theme_blazy(), or view builder.
   *
   * @param array $data
   *   An array of data containing settings, and image item.
   * @param object $entity
   *   The media entity, else file entity to be associated to media if any.
   * @param string $fallback
   *   The fallback string to display such as file name or entity label.
   *
   * @return array
   *   The renderable array of theme_blazy(), or view builder, else empty array.
   */
  public function build(array &$data, $entity, $fallback = '');

  /**
   * Returns the entity view, if available.
   *
   * @param object $entity
   *   The entity being rendered.
   * @param array $settings
   *   The settings containing view_mode.
   * @param string $fallback
   *   The fallback content when all fails, probably just entity label.
   *
   * @return array|bool
   *   The renderable array of the view builder, or false if not applicable.
   */
  public function getEntityView($entity, array $settings = [], $fallback = '');

}

Members

Namesort descending Modifiers Type Description Overrides
BlazyEntityInterface::build public function Build image/video preview either using theme_blazy(), or view builder. 1
BlazyEntityInterface::getEntityView public function Returns the entity view, if available. 1