public DraggableListBuilder::buildRow(EntityInterface $entity)
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
- core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php, line 70
Class
- DraggableListBuilder
- Defines a class to build a draggable listing of configuration entities.
Namespace
Drupal\Core\Config\Entity
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 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 ); } |
Please login to continue.