public function NodeAccess::isAccessRecordExisting in Permissions by Term 8
Same name and namespace in other branches
- 8.2 src/Service/NodeAccess.php \Drupal\permissions_by_term\Service\NodeAccess::isAccessRecordExisting()
Parameters
int $nid:
Return value
bool
File
- src/
Service/ NodeAccess.php, line 283
Class
- NodeAccess
- Class NodeAccess
Namespace
Drupal\permissions_by_term\ServiceCode
public function isAccessRecordExisting($nid) {
$query = $this->database
->select('node_access', 'na')
->fields('na', [
'nid',
])
->condition('na.nid', $nid)
->condition('na.realm', AccessStorage::NODE_ACCESS_REALM);
$result = $query
->execute()
->fetchCol();
if (empty($result)) {
return FALSE;
}
return TRUE;
}