You are here

function private_content_get_value in Private 8.2

Return value for private field, sanitised based on the node's content type.

Parameters

\Drupal\node\NodeInterface $node: Node to check

Return value

boolean Value

2 calls to private_content_get_value()
private_content_node_access in ./private_content.module
Implements hook_node_access().
private_content_node_access_records in ./private_content.module
Implements hook_node_access_records().

File

./private_content.module, line 265
A tremendously simple access control module -- it allows users to mark individual nodes as private; users with 'access private content' perms can read these nodes, while others cannot.

Code

function private_content_get_value(NodeInterface $node) {
  $value = $node->private->value;
  if ($value == NULL || private_content_is_locked($node)) {
    return private_content_get_default($node);
  }
  return $value;
}