You are here

public function GathercontentMappingEditForm::checkMetatag in GatherContent 8

Check if content type has any metatag fields.

Parameters

$content_type: Machine name of content type.

Return value

bool TRUE if metatag field exists.

File

src/Form/GathercontentMappingEditForm.php, line 391

Class

GathercontentMappingEditForm
Class GathercontentMappingEditForm.

Namespace

Drupal\gathercontent\Form

Code

public function checkMetatag($content_type) {
  $instances = $this->entityManager
    ->getFieldDefinitions('node', $content_type);
  foreach ($instances as $name => $instance) {
    if ($instance
      ->getType() === 'metatag') {
      return TRUE;
    }
  }
  return FALSE;
}