You are here

public static function Heartbeat::flagAjaxBuilder in Heartbeat 8

5 calls to Heartbeat::flagAjaxBuilder()
FriendInteractBlock::build in src/Plugin/Block/FriendInteractBlock.php
HeartbeatBlock::renderMessage in src/Plugin/Block/HeartbeatBlock.php
HeartbeatHashBlock::renderMessage in src/Plugin/Block/HeartbeatHashBlock.php
HeartbeatMoreBlock::renderMessage in src/Plugin/Block/HeartbeatMoreBlock.php
HeartbeatUsernameBlock::renderMessage in src/Plugin/Block/HeartbeatUsernameBlock.php

File

src/Entity/Heartbeat.php, line 849

Class

Heartbeat

Namespace

Drupal\heartbeat\Entity

Code

public static function flagAjaxBuilder($flagId, $entity, FlagService $flagService) {
  $flag = $flagService
    ->getFlagById($flagId);
  $key = 'flag_' . $flag
    ->id();
  $data = [
    '#lazy_builder' => [
      'flag.link_builder:build',
      [
        $entity
          ->getEntityTypeId(),
        $entity
          ->id(),
        $flag
          ->id(),
      ],
    ],
    '#create_placeholder' => TRUE,
  ];
  return [
    $key => $data,
  ];
}