Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Array
- (
- [uuid] => 32eeda5f-270f-477d-b24c-75ed15e69b2a
- [langcode] => en
- [status] => 1
- [dependencies] => Array
- (
- [module] => Array
- (
- [0] => node
- [1] => taxonomy
- )
- )
- [id] => node.field_event_type
- [field_name] => field_event_type
- [entity_type] => node
- [type] => entity_reference
- [settings] => Array
- (
- [target_type] => taxonomy_term
- )
- [module] => core
- [locked] =>
- [cardinality] => 1
- [translatable] => 1
- [indexes] => Array
- (
- )
- [persist_with_no_fields] =>
- [custom_storage] =>
- )
- Drupal::config('field.storage.node.field_event_type')->get();
- $handler = $field_data['settings']['handler'];
- $bundle = 'page';
- $vocs = [];
- $flds = Drupal::service('entity_field.manager')
- ->getFieldDefinitions('node', $bundle);
- foreach ($flds as $fld) {
- $hand = $fld->getSettings()['handler'];
- if ($hand == "default:taxonomy_term") {
- $fldnm = $fld->getName();
- $config = $fld->get('dependencies')['config'];
- foreach($config as $cf){
- if(strpos($cf,"taxonomy.vocabulary") !== FALSE){
- $vocs[$fldnm] = str_replace("taxonomy.vocabulary.","",$cf);
- }
- }
- }
- }
- dpm($vocs);
Add Comment
Please, Sign In to add comment