You are here

public function LingotekProfileListBuilder::buildRow in Lingotek Translation 8

Same name and namespace in other branches
  1. 8.2 src/LingotekProfileListBuilder.php \Drupal\lingotek\LingotekProfileListBuilder::buildRow()
  2. 4.0.x src/LingotekProfileListBuilder.php \Drupal\lingotek\LingotekProfileListBuilder::buildRow()
  3. 3.0.x src/LingotekProfileListBuilder.php \Drupal\lingotek\LingotekProfileListBuilder::buildRow()
  4. 3.1.x src/LingotekProfileListBuilder.php \Drupal\lingotek\LingotekProfileListBuilder::buildRow()
  5. 3.2.x src/LingotekProfileListBuilder.php \Drupal\lingotek\LingotekProfileListBuilder::buildRow()
  6. 3.3.x src/LingotekProfileListBuilder.php \Drupal\lingotek\LingotekProfileListBuilder::buildRow()
  7. 3.4.x src/LingotekProfileListBuilder.php \Drupal\lingotek\LingotekProfileListBuilder::buildRow()
  8. 3.5.x src/LingotekProfileListBuilder.php \Drupal\lingotek\LingotekProfileListBuilder::buildRow()
  9. 3.6.x src/LingotekProfileListBuilder.php \Drupal\lingotek\LingotekProfileListBuilder::buildRow()
  10. 3.7.x src/LingotekProfileListBuilder.php \Drupal\lingotek\LingotekProfileListBuilder::buildRow()
  11. 3.8.x src/LingotekProfileListBuilder.php \Drupal\lingotek\LingotekProfileListBuilder::buildRow()

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 DraggableListBuilder::buildRow

See also

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

File

src/LingotekProfileListBuilder.php, line 108

Class

LingotekProfileListBuilder
Defines a class to build a listing of Lingotek profile entities.

Namespace

Drupal\lingotek

Code

public function buildRow(EntityInterface $entity) {
  $row['label'] = $this
    ->getLabel($entity);
  $row['auto_upload'] = array(
    '#type' => 'checkbox',
    '#title' => t('Set @title for automatic upload', array(
      '@title' => $entity
        ->label(),
    )),
    '#title_display' => 'invisible',
    '#disabled' => $entity
      ->isLocked(),
    '#default_value' => $entity
      ->hasAutomaticUpload(),
  );
  $row['auto_download'] = array(
    '#type' => 'checkbox',
    '#title' => t('Set @title for automatic download', array(
      '@title' => $entity
        ->label(),
    )),
    '#title_display' => 'invisible',
    '#disabled' => $entity
      ->isLocked(),
    '#default_value' => $entity
      ->hasAutomaticDownload(),
  );
  return $row + parent::buildRow($entity);
}