Skip to content
Snippets Groups Projects
UWServiceInterface.php 1.08 KiB
Newer Older
<?php

namespace Drupal\uw_cfg_common\Service;

use Drupal\Core\Entity\EntityInterface;
Liam Morland's avatar
Liam Morland committed
/**
 * Interface UWServiceInterface.
 * Interface that is collection of common functions used in custom blocks.
 *
 * @package Drupal\uw_cfg_common\Service
Liam Morland's avatar
Liam Morland committed
 */
interface UWServiceInterface {

  /**
   * Prepares responsive image.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   Image entity.
   * @param string $image_style
   *   Image style to be used for responsive image.
   *
   * @return array
Liam Morland's avatar
Liam Morland committed
   *   Array with details for responsive image.
   */
  public function prepareResponsiveImage(EntityInterface $entity, string $image_style): array;
Liam Morland's avatar
Liam Morland committed

  /**
   * Prepares teaser.
   *
   * @param \Drupal\node\NodeInterface $node
   *   Node entity.
   * @param array $variables_to_get
   *   List of variables to return.
   * @param string $teaser_type
   *   Teaser type.
   *
   * @return array
   *   Array of variables and their values.
   */
  public function getTeaserContent(NodeInterface $node, array $variables_to_get, string $teaser_type): array;