You are here

public static function Heartbeat::getEntityNames in Heartbeat 8

File

src/Entity/Heartbeat.php, line 800

Class

Heartbeat

Namespace

Drupal\heartbeat\Entity

Code

public static function getEntityNames($entityTypes) {
  $names = array();
  foreach ($entityTypes as $type) {
    if ($type
      ->getBaseTable() === 'node' || $type
      ->getBaseTable() === 'user' || $type
      ->getBaseTable() === 'status' || $type
      ->getStorageClass() !== NULL && strpos($type
      ->getStorageClass(), $type
      ->getLabel()
      ->getUntranslatedString())) {
      $names[] = $type
        ->id();
    }
  }
  sort($names);
  return $names;
}