You are here

public function ImageStyleWithPipelineListBuilder::buildRow in Image Optimize (or ImageAPI Optimize) 8.2

Same name and namespace in other branches
  1. 8.3 src/ImageStyleWithPipelineListBuilder.php \Drupal\imageapi_optimize\ImageStyleWithPipelineListBuilder::buildRow()
  2. 4.x src/ImageStyleWithPipelineListBuilder.php \Drupal\imageapi_optimize\ImageStyleWithPipelineListBuilder::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 ImageStyleListBuilder::buildRow

See also

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

File

src/ImageStyleWithPipelineListBuilder.php, line 34

Class

ImageStyleWithPipelineListBuilder
Defines a class to build a listing of image optimize pipeline entities.

Namespace

Drupal\imageapi_optimize

Code

public function buildRow(EntityInterface $entity) {

  /** @var \Drupal\imageapi_optimize\Entity\ImageStyleWithPipeline $entity */
  $pipelineNames = imageapi_optimize_pipeline_options(FALSE);
  $row = parent::buildRow($entity);
  $row['pipeline'] = isset($pipelineNames[$entity
    ->getPipeline()]) ? $pipelineNames[$entity
    ->getPipeline()] : '';

  // Move 'operations' to the end.
  $operations = $row['operations'];
  unset($row['operations']);
  $row['operations'] = $operations;
  return $row;
}