I'm working in the context of a Views plugin. I have $entity_type
and $field
, as required in the snippet below. How can I get the bundle constraint for the entity reference field programmatically?
/** @var Drupal\field\Entity\FieldStorageConfig $field_configuration */
$field_configuration = FieldStorageConfig::loadByName($entity_type, $field);
$field_configuration->getType()
gives me "entity_reference"
$field_configuration->getSettings()['target_type']
gives me "taxonomy_term"
...but what methods return the vocabulary or vocabularies (bundles) that the entity reference field is set to be limited by (if at all) in its configuration?