You are here

function access_by_ref_get_config in Access by Reference 8

Same name and namespace in other branches
  1. 8.2 access_by_ref.module \access_by_ref_get_config()
1 call to access_by_ref_get_config()
access_by_ref_node_access in ./access_by_ref.module

File

./access_by_ref.module, line 165

Code

function access_by_ref_get_config(NodeInterface $node) {
  $my_type = $node
    ->getType();
  $sql = 'SELECT * FROM {access_by_ref} WHERE `node_type` = :ntype';

  // query the database for the set of configured access methods
  $result = \Drupal::database()
    ->query($sql, array(
    ':ntype' => $my_type,
  ));
  $rows = array();
  while ($row = $result
    ->fetchAssoc()) {
    $rows[] = $row;
  }
  return $rows;
}