Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uw_cfg_common
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WCMS
uw_cfg_common
Commits
f47b2597
Commit
f47b2597
authored
4 years ago
by
Igor Biki
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Service/UWService.php
+3
-2
3 additions, 2 deletions
src/Service/UWService.php
src/Service/UWServiceInterface.php
+20
-1
20 additions, 1 deletion
src/Service/UWServiceInterface.php
with
23 additions
and
3 deletions
src/Service/UWService.php
+
3
−
2
View file @
f47b2597
...
...
@@ -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
)
{
...
...
This diff is collapsed.
Click to expand it.
src/Service/UWServiceInterface.php
+
20
−
1
View file @
f47b2597
...
...
@@ -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
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment