diff --git a/src/Service/UWService.php b/src/Service/UWService.php index 52a1e84b5e9eb901cc2635475dfe2d1d2ad4fbac..821964d7cc5176495b78e77006f90b37fb1c3f92 100644 --- a/src/Service/UWService.php +++ b/src/Service/UWService.php @@ -3,10 +3,11 @@ namespace Drupal\uw_cfg_common\Service; use Drupal\Core\Entity\EntityInterface; +use Drupal\node\Entity\Node; use Drupal\node\NodeInterface; /** - * Class UWService. + * Class UWService * * @package Drupal\uw_cfg_common\Service */ @@ -48,7 +49,7 @@ class UWService implements UWServiceInterface { * {@inheritDoc} */ public function getTeaserContent(NodeInterface $node, array $variables_to_get, string $teaser_type): array { - + $variables = []; // Step through each of the variables to get and set the variables for the // teaser content. foreach ($variables_to_get as $variable_to_get) { diff --git a/src/Service/UWServiceInterface.php b/src/Service/UWServiceInterface.php index c67970033d33eb7611ad410ce479c9382c1992df..360bbf854105a40e71b107adc78dc807751d1b78 100644 --- a/src/Service/UWServiceInterface.php +++ b/src/Service/UWServiceInterface.php @@ -3,9 +3,14 @@ namespace Drupal\uw_cfg_common\Service; use Drupal\Core\Entity\EntityInterface; +use Drupal\node\NodeInterface; /** - * Interface for UW services. + * Interface UWServiceInterface + * + * Interface that is collection of common functions used throughout custom blocks. + * + * @package Drupal\uw_cfg_common\Service */ interface UWServiceInterface { @@ -22,4 +27,18 @@ interface UWServiceInterface { */ public function prepareResponsiveImage(EntityInterface $entity, string $image_style): array; + /** + * 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; }