You are here

private function VarnishImagePurgeConfiguration::getOptionsFromEntity in Varnish purger 8

Same name and namespace in other branches
  1. 8.2 modules/varnish_image_purge/src/Form/VarnishImagePurgeConfiguration.php \Drupal\varnish_image_purge\Form\VarnishImagePurgeConfiguration::getOptionsFromEntity()

Get the bundles form an entity and format as options.

Parameters

\Drupal\Core\Entity\ContentEntityType $content_entity_type: The entity to get the bundles from.

Return value

array Fortmatted options.

1 call to VarnishImagePurgeConfiguration::getOptionsFromEntity()
VarnishImagePurgeConfiguration::buildForm in modules/varnish_image_purge/src/Form/VarnishImagePurgeConfiguration.php
Form constructor.

File

modules/varnish_image_purge/src/Form/VarnishImagePurgeConfiguration.php, line 159

Class

VarnishImagePurgeConfiguration
Configure site information settings for this site.

Namespace

Drupal\varnish_image_purge\Form

Code

private function getOptionsFromEntity(ContentEntityType $content_entity_type) {
  $bundles = $this->entityTypeBundleInfo
    ->getBundleInfo($content_entity_type
    ->id());
  $options = [];
  foreach ($bundles as $key => $bundle) {
    $options[$key] = $bundle['label'];
  }
  return $options;
}