You are here

public function NodeViewCountRecordsManager::isRecordableForNodeType in Node view count 8

Checks whether node of given node type should be counted in statistics.

Parameters

\Drupal\node\NodeInterface $node: Node object.

Return value

bool TRUE if node of given node type should be counted in statistics.

Overrides NodeViewCountRecordsManagerInterface::isRecordableForNodeType

1 call to NodeViewCountRecordsManager::isRecordableForNodeType()
NodeViewCountRecordsManager::getNodeViewsCount in src/NodeViewCountRecordsManager.php
Return count of node views.

File

src/NodeViewCountRecordsManager.php, line 124

Class

NodeViewCountRecordsManager
Provides a class for interacting with nodeviewcount records.

Namespace

Drupal\nodeviewcount

Code

public function isRecordableForNodeType(NodeInterface $node) {
  $tracked_unode_types = $this->config
    ->get('node_types');
  return in_array($node
    ->bundle(), $tracked_unode_types, TRUE);
}