You are here

function DBManager::is_exist_node in Content Export YAML 8

File

modules/manager_content_export_yaml/src/DBManager.php, line 117

Class

DBManager

Namespace

Drupal\content_export_yaml

Code

function is_exist_node($id, $bundle, $entity) {
  $bundle_label = \Drupal::entityTypeManager()
    ->getDefinition($entity)
    ->getKey('bundle');
  $id_label = \Drupal::entityTypeManager()
    ->getDefinition($entity)
    ->getKey('id');
  return \Drupal::entityTypeManager()
    ->getStorage($entity)
    ->loadByProperties([
    $id_label => $id,
    $bundle_label => $bundle,
  ]);
}