You are here

private function BlogapiCommunicator::getCtFieldTargetBundles in Blog API 8

Returns all vocabulary ids that can be saved in a field.

Parameters

$ct: Content type machine name.

$field_name: The field name.

Return value

array Array of strings.

1 call to BlogapiCommunicator::getCtFieldTargetBundles()
BlogapiCommunicator::setPostCategories in src/BlogapiCommunicator.php
Callback for saving tags on a node.

File

src/BlogapiCommunicator.php, line 506

Class

BlogapiCommunicator
Class BlogapiCommunicator.

Namespace

Drupal\blogapi

Code

private function getCtFieldTargetBundles($ct, $field_name) {
  $definitions = $this->entityFieldManager
    ->getFieldDefinitions('node', $ct);
  $field = $definitions[$field_name];
  $settings = $field
    ->getSetting('handler_settings');
  return array_keys($settings['target_bundles']);
}