You are here

protected function BulkEditFormTrait::getBundleEntity in Views Bulk Edit 8.2

Returns the bundle entity of the entity, or NULL if there is none.

Return value

\Drupal\Core\Entity\EntityInterface|null The bundle entity.

See also

\Drupal\Core\Entity\ContentEntityForm::getBundleEntity()

1 call to BulkEditFormTrait::getBundleEntity()
BulkEditFormTrait::getNewRevisionDefault in src/Form/BulkEditFormTrait.php
Should new revisions be created by default?

File

src/Form/BulkEditFormTrait.php, line 213

Class

BulkEditFormTrait
Common methods for Views Bulk Edit forms.

Namespace

Drupal\views_bulk_edit\Form

Code

protected function getBundleEntity($entity) {
  if ($bundle_entity_type = $entity
    ->getEntityType()
    ->getBundleEntityType()) {
    return $this->entityTypeManager
      ->getStorage($bundle_entity_type)
      ->load($entity
      ->bundle());
  }
  return NULL;
}