public function WebformContentCreatorListBuilder::buildRow in Webform Content Creator 8
Same name and namespace in other branches
- 3.x src/Controller/WebformContentCreatorListBuilder.php \Drupal\webform_content_creator\Controller\WebformContentCreatorListBuilder::buildRow()
- 2.x src/Controller/WebformContentCreatorListBuilder.php \Drupal\webform_content_creator\Controller\WebformContentCreatorListBuilder::buildRow()
Constructs the table rows.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: Webform content creator entity.
Return value
\Drupal\Core\Entity\EntityListBuilder A render array structure of fields for this entity.
Overrides EntityListBuilder::buildRow
File
- src/
Controller/ WebformContentCreatorListBuilder.php, line 42
Class
- WebformContentCreatorListBuilder
- Provides a list of Webform Content Creator entities.
Namespace
Drupal\webform_content_creator\ControllerCode
public function buildRow(EntityInterface $entity) {
$webform = \Drupal::entityTypeManager()
->getStorage(self::WEBFORM)
->load($entity
->getWebform());
$content_type = \Drupal::entityTypeManager()
->getStorage('node_type')
->load($entity
->getContentType());
if (!empty($webform) && !empty($content_type)) {
$row[self::TITLE] = $entity
->get('title') . ' (' . $entity
->id() . ')';
$row[self::WEBFORM] = $webform
->label() . ' (' . $entity
->getWebform() . ')';
$row[self::CONTENT_TYPE] = $content_type
->label() . ' (' . $entity
->getContentType() . ')';
return $row + parent::buildRow($entity);
}
return parent::buildRow($entity);
}