Skip to content
Snippets Groups Projects
Commit 76aac44f authored by Eric Bremner's avatar Eric Bremner Committed by Eric Bremner
Browse files

ISTWCMS-4704: removing functions that are no longer required

parent 81bc913c
No related branches found
No related tags found
1 merge request!112Feature/istwcms 4704 m26lebla ebremner content types
......@@ -551,104 +551,6 @@ class UWService implements UWServiceInterface {
}
}
/**
* {@inheritDoc}
*/
public function uwGetHeaderData(Node $node): array {
// Array to hold the header data, need to set to
// null in case there are no header data to be
// returned.
$header_data = [];
// Get the header data, depending on the content type.
switch ($node->getType()) {
case 'uw_ct_blog';
// Set the header data.
$header_data = [
'date' => date('l, F j, Y', strtotime($node->field_uw_blog_date->value)),
'author' => $this->uwGetAuthor($node),
'title' => $node->getTitle(),
];
break;
case 'uw_ct_event':
// Get all the dates.
// @todo figure out what date to display.
$dates = $node->field_uw_event_date->getValue();
// Set the header data.
$header_data = [
'date' => date('l, F j, Y', $dates[0]['value']),
'title' => $node->getTitle(),
];
break;
case 'uw_ct_news_item':
// Set the header data.
$header_data = [
'date' => date('l, F j, Y', strtotime($node->field_uw_news_date->value)),
'title' => $node->getTitle(),
];
break;
}
// Return the header data.
return $header_data;
}
/**
* {@inheritDoc}
*/
public function uwGetFooterData(Node $node): array {
// Array to hold the footer data, need to set to
// null in case there are no footer data to be
// returned.
$footer_data = [];
// Get the footer data, depending on the content type.
switch ($node->getType()) {
case 'uw_ct_blog';
$tags = $this->uwGetTermsFromEntityField($node->get('field_uw_blog_tags'), 'tags');
$audiences = $this->uwGetTermsFromEntityField($node->get('field_uw_audience'), 'tags');
$footer_data = [
'tags' => [
array_merge($tags, $audiences),
],
];
break;
case 'uw_ct_event';
$tags = $this->uwGetTermsFromEntityField($node->get('field_uw_event_tags'), 'tags');
$audiences = $this->uwGetTermsFromEntityField($node->get('field_uw_audience'), 'tags');
$types = $this->uwGetTermsFromEntityField($node->get('field_uw_event_type'), 'tags');
$footer_data = [
'tags' => [
array_merge($tags, $audiences, $types),
],
];
break;
case 'uw_ct_news_item';
$tags = $this->uwGetTermsFromEntityField($node->get('field_uw_news_tags'), 'tags');
$audiences = $this->uwGetTermsFromEntityField($node->get('field_uw_audience'), 'tags');
$footer_data = [
'tags' => [
array_merge($tags, $audiences),
],
];
break;
}
// Return the header data.
return $footer_data;
}
/**
* {@inheritDoc}
*/
......
......@@ -183,28 +183,6 @@ interface UWServiceInterface {
*/
public function uwMonthNameShort(int $month = NULL);
/**
* A function to get the header data for a node/content type.
*
* @param \Drupal\node\Entity\Node $node
* The node object.
*
* @return array
* An array containing the header data for a node/content type.
*/
public function uwGetHeaderData(Node $node): array;
/**
* A function to get the footer data for a node/content type.
*
* @param \Drupal\node\Entity\Node $node
* The node object.
*
* @return array
* An array containing the footer data for a node/content type.
*/
public function uwGetFooterData(Node $node): array;
/**
* A function get the taxonomy terms.
*
......
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