function DraggableListBuilderTrait::buildRow
Same name in other branches
- 10 core/lib/Drupal/Core/Entity/DraggableListBuilderTrait.php \Drupal\Core\Entity\DraggableListBuilderTrait::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 for an entity row.
See also
\Drupal\Core\Entity\EntityListBuilder::buildRow()
6 calls to DraggableListBuilderTrait::buildRow()
- DraggableListBuilderTrait::buildForm in core/
lib/ Drupal/ Core/ Entity/ DraggableListBuilderTrait.php - Form constructor.
- FilterFormatListBuilder::buildRow in core/
modules/ filter/ src/ FilterFormatListBuilder.php - Builds a row for an entity in the entity listing.
- LanguageListBuilder::buildRow in core/
modules/ language/ src/ LanguageListBuilder.php - Builds a row for an entity in the entity listing.
- RoleListBuilder::buildRow in core/
modules/ user/ src/ RoleListBuilder.php - Builds a row for an entity in the entity listing.
- SearchPageListBuilder::buildRow in core/
modules/ search/ src/ SearchPageListBuilder.php - Builds a row for an entity in the entity listing.
5 methods override DraggableListBuilderTrait::buildRow()
- FilterFormatListBuilder::buildRow in core/
modules/ filter/ src/ FilterFormatListBuilder.php - Builds a row for an entity in the entity listing.
- LanguageListBuilder::buildRow in core/
modules/ language/ src/ LanguageListBuilder.php - Builds a row for an entity in the entity listing.
- RoleListBuilder::buildRow in core/
modules/ user/ src/ RoleListBuilder.php - Builds a row for an entity in the entity listing.
- SearchPageListBuilder::buildRow in core/
modules/ search/ src/ SearchPageListBuilder.php - Builds a row for an entity in the entity listing.
- VocabularyListBuilder::buildRow in core/
modules/ taxonomy/ src/ VocabularyListBuilder.php - Builds a row for an entity in the entity listing.
File
-
core/
lib/ Drupal/ Core/ Entity/ DraggableListBuilderTrait.php, line 93
Class
- DraggableListBuilderTrait
- Provides a trait for draggable listings of entities.
Namespace
Drupal\Core\EntityCode
public function buildRow(EntityInterface $entity) {
$row = [];
if (!empty($this->weightKey)) {
// Override default values to markup elements.
$row['#attributes']['class'][] = 'draggable';
$row['#weight'] = $this->getWeight($entity);
// Add weight column.
$row['weight'] = [
'#type' => 'weight',
'#title' => t('Weight for @title', [
'@title' => $entity->label(),
]),
'#title_display' => 'invisible',
'#default_value' => $this->getWeight($entity),
'#attributes' => [
'class' => [
'weight',
],
],
];
}
return $row + parent::buildRow($entity);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.