You are here

public function DisqusCommentManager::getAllFields in Disqus 8

Utility function to return all disqus_comment fields.

Overrides DisqusCommentManagerInterface::getAllFields

1 call to DisqusCommentManager::getAllFields()
DisqusCommentManager::getFields in src/DisqusCommentManager.php
Utility function to return an array of disqus_comment fields.

File

src/DisqusCommentManager.php, line 93

Class

DisqusCommentManager
It contains common functions to manage disqus_comment fields.

Namespace

Drupal\disqus

Code

public function getAllFields() {
  $map = $this->entityFieldManager
    ->getFieldMap();

  // Build a list of disqus comment fields only.
  $disqus_comment_fields = [];
  foreach ($map as $entity_type => $data) {
    foreach ($data as $field_name => $field_info) {
      if ($field_info['type'] == 'disqus_comment') {
        $disqus_comment_fields[$entity_type][$field_name] = $field_info;
      }
    }
  }
  return $disqus_comment_fields;
}