public DraggableListBuilder::buildRow(EntityInterface $entity)
Builds a row for an entity in the entity listing.
\Drupal\Core\Entity\EntityInterface $entity: The entity for this row of the list.
array A render array structure of fields for this entity.
Overrides EntityListBuilder::buildRow
\Drupal\Core\Entity\EntityListBuilder::render()
public function buildRow(EntityInterface $entity) { $row = array(); if (!empty($this->weightKey)) { // Override default values to markup elements. $row['#attributes']['class'][] = 'draggable'; $row['#weight'] = $entity->get($this->weightKey); // Add weight column. $row['weight'] = array( '#type' => 'weight', '#title' => t('Weight for @title', array('@title' => $entity->label())), '#title_display' => 'invisible', '#default_value' => $entity->get($this->weightKey), '#attributes' => array('class' => array('weight')), ); } return $row + parent::buildRow($entity); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Config!Entity!DraggableListBuilder.php/function/DraggableListBuilder::buildRow/8.1.x