getStorage('node_type')->loadMultiple(); foreach ($node_types as $type => $info) { $list[$type] = 'node'; } // Install our fields. foreach ($list as $bundle => $entity_type) { domain_access_confirm_fields($entity_type, $bundle); } // Install our actions. $domains = \Drupal::service('entity_type.manager')->getStorage('domain')->loadMultiple(); foreach ($domains as $domain) { domain_access_domain_insert($domain); } }