function _webform_component_roles_component_roles in Webform Component Roles 7
Same name and namespace in other branches
- 6 webform_component_roles.module \_webform_component_roles_component_roles()
Fetch the roles of a component by the webform node ID and component ID.
Parameters
int $nid: The node ID that the webform belongs.
int $cid: The component ID within that webform.
Return value
array An array of role ID's.
1 call to _webform_component_roles_component_roles()
File
- ./
webform_component_roles.module, line 324 - This module adds a list of checkboxes for each Drupal role to the webform component edit form. It then only allows those roles to view that webform component when the webform is viewed.
Code
function _webform_component_roles_component_roles($nid, $cid) {
return db_select('webform_component_roles', 'w', array(
'fetch' => PDO::FETCH_ASSOC,
))
->condition('w.nid', $nid)
->condition('w.cid', $cid)
->fields('w')
->execute()
->fetchAllKeyed(2, 3);
}