You are here

public function KanbanColumn::build in Content Planner 8

Builds a Kanban Column.

Return value

array Returns a renderable array for the current Kanban column.

File

modules/content_kanban/src/Component/KanbanColumn.php, line 80

Class

KanbanColumn
Class KanbanColumn.

Namespace

Drupal\content_kanban\Component

Code

public function build() {

  // Change here too the array structure.
  $entity_builds = [];

  // I set directly the type on the entity.
  foreach ($this->entities as $entity) {
    $kanbanEntry = new KanbanEntry($entity, $this->stateID, $this->entityTypeConfigs[$entity->type]);
    $entity_builds[] = $kanbanEntry
      ->build();
  }
  $build = [
    '#theme' => 'content_kanban_column',
    '#column_id' => $this->workflowID . '-' . $this->stateID,
    '#workflow_id' => $this->workflowID,
    '#state_id' => $this->stateID,
    '#state_label' => $this->stateInfo['label'],
    '#entities' => $entity_builds,
  ];
  return $build;
}