private function getSummary($node) {
    if (!($node instanceof NodeInterface)) {
      $node = $this->entityTypeManager->getStorage('node')->load($node);
    }

    $registeredMembers = $this->calculateRegisteredMembers($node);
    $totalMembers = $this->calculateAllMembers();
    $percentageMembers = 0;
    if ($totalMembers > 0) {
      $percentageMembers = round($registeredMembers / $totalMembers * 100, 2);
    }

    $activities = $this->calculateTrackedActivities($node);

    return [
      'registeredMembers' => $registeredMembers,
      'totalMembers' => $totalMembers,
      'percentageMembers' => $percentageMembers,
      'activities' => $activities,
    ];
  }
private function getSummary($node) {
    if (!($node instanceof NodeInterface)) {
      $node = $this->entityTypeManager->getStorage('node')->load($node);
    }

    $registeredMembers = $this->calculateRegisteredMembers($node);
    $totalMembers = $this->calculateAllMembers();
    $percentageMembers = 0;
    if ($totalMembers > 0) {
      $percentageMembers = round($registeredMembers / $totalMembers * 100, 2);
    }

    $activities = $this->calculateTrackedActivities($node);

    return [
      'registeredMembers' => $registeredMembers,
      'totalMembers' => $totalMembers,
      'percentageMembers' => $percentageMembers,
      'activities' => $activities,
    ];
  }
private function getSummary ( $ node ) { if ( ! ( $ node instanceof NodeInterface ) ) { $ node = $ this -> entityTypeManager -> getStorage ( 'node' ) -> load ( $ node ) ; } $ registeredMembers = $ this -> calculateRegisteredMembers ( $ node ) ; $ totalMembers = $ this -> calculateAllMembers ( ) ; $ percentageMembers = 0 ; if ( $ totalMembers > 0 ) { $ percentageMembers = round ( $ registeredMembers / $ totalMembers * 100 , 2 ) ; } $ activities = $ this -> calculateTrackedActivities ( $ node ) ; return [ 'registeredMembers' => $ registeredMembers , 'totalMembers' => $ totalMembers , 'percentageMembers' => $ percentageMembers , 'activities' => $ activities , ] ; }
Get summary by the node.

@param \Drupal\node\NodeInterface|int $node

@return array Render array
Get summary by the node .