function _support_ticket_exists in Support Ticketing System 7
Same name and namespace in other branches
- 6 support.module \_support_ticket_exists()
Helper function to determine if a user has support tickets already.
1 call to _support_ticket_exists()
- support_page_user_access in ./
support.module - Access callback for user support ticket pages.
File
- ./
support.module, line 3082 - support.module
Code
function _support_ticket_exists($account) {
$result = db_select('node', 'n')
->fields('n', array(
'nid',
'created',
))
->condition('type', 'support_ticket')
->condition('status', 1)
->condition('uid', $account->uid)
->addTag('node_access')
->addTag('support_search')
->execute()
->fetchField();
return (bool) $result;
}