From 4ee015f234d6d41bd0813599317668f13110fda6 Mon Sep 17 00:00:00 2001
From: Eric Bremner <ebremner@uwaterloo.ca>
Date: Mon, 29 Nov 2021 04:31:54 +0000
Subject: [PATCH] ISTWCMS-5204: adding function to UWService to get the
 responsive image styles

---
 src/Service/UWService.php          | 13 +++++++++++++
 src/Service/UWServiceInterface.php |  8 ++++++++
 2 files changed, 21 insertions(+)

diff --git a/src/Service/UWService.php b/src/Service/UWService.php
index d2cb0b7d..032cfc37 100644
--- a/src/Service/UWService.php
+++ b/src/Service/UWService.php
@@ -146,6 +146,19 @@ class UWService implements UWServiceInterface {
     return [];
   }
 
+  /**
+   * {@inheritDoc}
+   */
+  public function uwGetResponsiveImageStyles(): array {
+    return [
+      'uw_is_media_x_large',
+      'uw_is_media_large',
+      'uw_is_media_medium',
+      'uw_is_media_small',
+      'uw_is_media_x_small',
+    ];
+  }
+
   /**
    * {@inheritDoc}
    */
diff --git a/src/Service/UWServiceInterface.php b/src/Service/UWServiceInterface.php
index 4eb19787..3b0fab07 100644
--- a/src/Service/UWServiceInterface.php
+++ b/src/Service/UWServiceInterface.php
@@ -36,6 +36,14 @@ interface UWServiceInterface {
    */
   public function prepareResponsiveImage(EntityInterface $entity, string $image_style): array;
 
+  /**
+   * Get the UW images styles used in UW responsive image.
+   *
+   * @return array
+   *   Array of image styles.
+   */
+  public function uwGetResponsiveImageStyles(): array;
+
   /**
    * Gets content types that have feature images.
    *
-- 
GitLab