You are here

public function AutoEntityLabelForm::getIds in Automatic Entity Label 8.3

1 call to AutoEntityLabelForm::getIds()
AutoEntityLabelForm::setBatch in src/Form/AutoEntityLabelForm.php

File

src/Form/AutoEntityLabelForm.php, line 332

Class

AutoEntityLabelForm
Class AutoEntityLabelForm.

Namespace

Drupal\auto_entitylabel\Form

Code

public function getIds($entity_type, $bundle) {
  $query = $this->entityTypeManager
    ->getStorage($bundle)
    ->getQuery();
  switch ($bundle) {
    case 'taxonomy_term':
      return $query
        ->condition('vid', $entity_type, 'IN')
        ->execute();
    case 'media':
      return $query
        ->condition('bundle', $entity_type, 'IN')
        ->execute();
    case 'comment':
      return $query
        ->condition('comment_type', $entity_type, 'IN')
        ->execute();
    default:
      return $query
        ->condition('type', $entity_type, 'IN')
        ->execute();
  }
}