public function DisqusCommentManager::getFields in Disqus 8
Utility function to return an array of disqus_comment fields.
Parameters
string $entity_type_id: The content entity type to which the disqus_comment fields are attached.
Return value
array An array of disqu...www/html/d8/modules/disqus/src /DisqusCommentManagerInterface.phps_comment field map definitions, keyed by field name. Each value is an array with two entries:
- type: The field type.
- bundles: The bundles in which field appears, as an array with entity types as keys and ...www/html/d8/modules/disqus/src
/DisqusCommentManagerInterface.phpthe array of bundle names as values.
Overrides DisqusCommentManagerInterface::getFields
See also
\Drupal\Core\Entity\EntityManagerInterface::getFieldMap()
File
- src/
DisqusCommentManager.php, line 80
Class
- DisqusCommentManager
- It contains common functions to manage disqus_comment fields.
Namespace
Drupal\disqusCode
public function getFields($entity_type_id) {
$entity_type = $this->entityTypeManager
->getDefinition($entity_type_id);
if (!$entity_type
->entityClassImplements('\\Drupal\\Core\\Entity\\ContentEntityInterface')) {
return [];
}
$map = $this
->getAllFields();
return isset($map[$entity_type_id]) ? $map[$entity_type_id] : [];
}