You are here

public function ParallaxElementListBuilder::buildRow in Parallax Background 8

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

See also

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

File

src/ParallaxElementListBuilder.php, line 27

Class

ParallaxElementListBuilder
Provides a listing of Parallax element entities.

Namespace

Drupal\parallax_bg

Code

public function buildRow(EntityInterface $entity) {

  /** @var \Drupal\parallax_bg\Entity\ParallaxElementInterface $entity */
  $row['label'] = $entity
    ->label();
  $row['position'] = $entity
    ->getPosition();
  $row['speed'] = $entity
    ->getSpeed();

  // You probably want a few more properties here...
  return $row + parent::buildRow($entity);
}