From 483d1ac9d96df89f8b2ab0f4c4782ddb8d994145 Mon Sep 17 00:00:00 2001 From: naomi Date: Sat, 14 Apr 2018 17:20:51 +0200 Subject: [PATCH] Added Involved Parties block for case page --- src/Plugin/Block/InvolvedParties.php | 40 ++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/Plugin/Block/InvolvedParties.php diff --git a/src/Plugin/Block/InvolvedParties.php b/src/Plugin/Block/InvolvedParties.php new file mode 100644 index 0000000..be835e0 --- /dev/null +++ b/src/Plugin/Block/InvolvedParties.php @@ -0,0 +1,40 @@ +getParameter('case_entity')->id(); + $markup = ""; + + $case = $entity = \Drupal::entityTypeManager()->getStorage('case_entity')->load($case_id); + $hats_involved = $case->hats_involved->referencedEntities(); + foreach($hats_involved as $hat) { + $person_id = $hat->person->first()->getValue()['target_id']; + $markup .= "

" . $hat->name->getString() . "

"; + } + return [ + '#cache' => [ + 'max-age' => 0, + ], + '#markup' => "" + ]; + + } + +}