Skip to content
Snippets Groups Projects
Commit f47b2597 authored by Igor Biki's avatar Igor Biki
Browse files

ISTWCMS-4032: Adding one more function to interface, and adding more comments.

parent bffe0efa
No related branches found
No related tags found
No related merge requests found
...@@ -3,10 +3,11 @@ ...@@ -3,10 +3,11 @@
namespace Drupal\uw_cfg_common\Service; namespace Drupal\uw_cfg_common\Service;
use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityInterface;
use Drupal\node\Entity\Node;
use Drupal\node\NodeInterface; use Drupal\node\NodeInterface;
/** /**
* Class UWService. * Class UWService
* *
* @package Drupal\uw_cfg_common\Service * @package Drupal\uw_cfg_common\Service
*/ */
...@@ -48,7 +49,7 @@ class UWService implements UWServiceInterface { ...@@ -48,7 +49,7 @@ class UWService implements UWServiceInterface {
* {@inheritDoc} * {@inheritDoc}
*/ */
public function getTeaserContent(NodeInterface $node, array $variables_to_get, string $teaser_type): array { 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 // Step through each of the variables to get and set the variables for the
// teaser content. // teaser content.
foreach ($variables_to_get as $variable_to_get) { foreach ($variables_to_get as $variable_to_get) {
......
...@@ -3,9 +3,14 @@ ...@@ -3,9 +3,14 @@
namespace Drupal\uw_cfg_common\Service; namespace Drupal\uw_cfg_common\Service;
use Drupal\Core\Entity\EntityInterface; 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 { interface UWServiceInterface {
...@@ -22,4 +27,18 @@ interface UWServiceInterface { ...@@ -22,4 +27,18 @@ interface UWServiceInterface {
*/ */
public function prepareResponsiveImage(EntityInterface $entity, string $image_style): array; 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;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment