You are here

public function FlagListsActionsActionListBuilder::buildRow in Flag Lists 4.0.x

Builds a row for an entity in the entity listing.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity for this row of the list.

Return value

array A render array structure of fields for this entity.

Overrides ActionListBuilder::buildRow

See also

\Drupal\Core\Entity\EntityListBuilder::render()

File

modules/flag_lists_actions/src/FlagListsActionsActionListBuilder.php, line 66

Class

FlagListsActionsActionListBuilder
Defines a class to build a listing of action entities.

Namespace

Drupal\flag_lists_actions

Code

public function buildRow(EntityInterface $entity) {
  if ($this->hasConfigurableActions) {
    if (!empty($entity
      ->get('configuration')['flag_id'])) {
      if ($this->flagListsService
        ->getFlaggingCollectionIdByRelated($entity
        ->get('configuration')['flag_id'])) {
        $config = $this->configFactory
          ->get('flag_lists.settings');
        if ($config
          ->get('hide_actions') == 1) {
          return NULL;
        }
      }
    }
    $row['type'] = $entity
      ->getType();
    $row['label'] = $entity
      ->label();
    $row += parent::buildRow($entity);
    return $row;
  }
}