You are here

public function EntityCloneSettingsManager::getContentEntityTypes in Entity Clone 8

Get all content entity types.

Return value

\Drupal\Core\Entity\ContentEntityTypeInterface[] An array containing all content entity types.

File

src/EntityCloneSettingsManager.php, line 66

Class

EntityCloneSettingsManager
Manage entity clone configuration.

Namespace

Drupal\entity_clone

Code

public function getContentEntityTypes() {
  $definitions = $this->entityTypeManager
    ->getDefinitions();
  $ret = [];
  foreach ($definitions as $machine => $type) {
    if ($type instanceof ContentEntityTypeInterface) {
      $ret[$machine] = $type;
    }
  }
  return $ret;
}