public function ForumManager::checkNodeType in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/forum/src/ForumManager.php \Drupal\forum\ForumManager::checkNodeType()
Checks whether a node can be used in a forum, based on its content type.
Parameters
\Drupal\node\NodeInterface $node: A node entity.
Return value
bool Boolean indicating if the node can be assigned to a forum.
Overrides ForumManagerInterface::checkNodeType
File
- core/
modules/ forum/ src/ ForumManager.php, line 472 - Contains \Drupal\forum\ForumManager.
Class
- ForumManager
- Provides forum manager service.
Namespace
Drupal\forumCode
public function checkNodeType(NodeInterface $node) {
// Fetch information about the forum field.
$field_definitions = $this->entityManager
->getFieldDefinitions('node', $node
->bundle());
return !empty($field_definitions['taxonomy_forums']);
}