How to check if an entity bundle has a field? How can I check if a bundle has a field? I know I can use $entity-&gt;hasField() if I have a specific entity (as is defined in this post), but how can I get this info with just the entity_type and bundle info?

I'm assuming I could just create an entity of the type and bundle (and never save it), and check against that, but that seems gross.
Woops, this is closely related to Get all fields defined in a bundle, but since that gets all fields, I'll post this.

Use the EntityFieldManager (entity_field.manager) service, specifically the getFieldDefinitions method, to get all field definitions, and then check for your specific field.

function doesBundleHaveField($entity_type = 'node', $bundle = 'page', $field_name = 'field_paragraphs') {
  $all_bundle_fields = \Drupal::service('entity_field.manager')-&gt;getFieldDefinitions($entity_type, $bundle);
  return isset($all_bundle_fields[$field_name]);
}