You are here

private function GatsbyAdminForm::getContentEntityTypes in Gatsby Live Preview & Incremental Builds 8

Same name and namespace in other branches
  1. 2.0.x src/Form/GatsbyAdminForm.php \Drupal\gatsby\Form\GatsbyAdminForm::getContentEntityTypes()

Gets a list of all the defined content entities in the system.

Return value

array An array of content entities definitions.

1 call to GatsbyAdminForm::getContentEntityTypes()
GatsbyAdminForm::buildForm in src/Form/GatsbyAdminForm.php
Form constructor.

File

src/Form/GatsbyAdminForm.php, line 226

Class

GatsbyAdminForm
Defines a config form to store Gatsby configuration.

Namespace

Drupal\gatsby\Form

Code

private function getContentEntityTypes() {
  $content_entity_types = [];
  $allEntityTypes = $this->entityTypeManager
    ->getDefinitions();
  foreach ($allEntityTypes as $entity_type_id => $entity_type) {

    // Add all content entity types but not the gatsby log entity provided
    // by the gatsby_fastbuilds module (if it exists).
    if ($entity_type instanceof ContentEntityTypeInterface && $entity_type_id !== 'gatsby_log_entity') {
      $content_entity_types[$entity_type_id] = $entity_type
        ->getLabel();
    }
  }
  return $content_entity_types;
}