You are here

public function BlogapiCommunicator::fieldIsTaxonomy in Blog API 8

Check if the passed field is a taxonomy field.

Parameters

$field: The field ID.

Return value

bool Returns the bool result.

2 calls to BlogapiCommunicator::fieldIsTaxonomy()
BlogapiCommunicator::getCtVocabularies in src/BlogapiCommunicator.php
Returns all the vocabularies whose terms that can be stored in a CT.
BlogapiCommunicator::getTaxonomyFields in src/BlogapiCommunicator.php
Helper method to find the taxonomy fields in a content type.

File

src/BlogapiCommunicator.php, line 184

Class

BlogapiCommunicator
Class BlogapiCommunicator.

Namespace

Drupal\blogapi

Code

public function fieldIsTaxonomy($field) {
  $type = $field
    ->getType();
  $handler = $field
    ->getSetting('handler');
  if ($handler == 'default:taxonomy_term' && $type == 'entity_reference') {
    return TRUE;
  }
  return FALSE;
}