You are here

public static function AddToAnySettingsForm::getContentEntities in AddToAny Share Buttons 8

Get all available content entities in the environment.

Return value

array

3 calls to AddToAnySettingsForm::getContentEntities()
AddToAnySettingsForm::buildForm in src/Form/AddToAnySettingsForm.php
Form constructor.
AddToAnySettingsForm::submitForm in src/Form/AddToAnySettingsForm.php
Form submission handler.
addtoany_entity_extra_field_info in ./addtoany.module
Implements hook_entity_extra_field_info().

File

src/Form/AddToAnySettingsForm.php, line 289

Class

AddToAnySettingsForm
Configure AddToAny settings for this site.

Namespace

Drupal\addtoany\Form

Code

public static function getContentEntities() {
  $content_entity_types = [];
  $entity_type_definitions = \Drupal::entityTypeManager()
    ->getDefinitions();

  /* @var $definition EntityTypeInterface */
  foreach ($entity_type_definitions as $definition) {
    if ($definition instanceof ContentEntityType) {
      $content_entity_types[] = $definition;
    }
  }
  return $content_entity_types;
}