function _webform_attributes_find_record_by_nid in Webform Attributes 7
Same name and namespace in other branches
- 7.2 includes/webform_attributes.functions.inc \_webform_attributes_find_record_by_nid()
Find an existing record.
Parameters
int $nid: Node nid.
Return value
array Return array with attributes when found it.
2 calls to _webform_attributes_find_record_by_nid()
File
- includes/
webform_attributes.functions.inc, line 86 - Functions related the Webform Attributes.
Code
function _webform_attributes_find_record_by_nid($nid, $parser = TRUE) {
$result = db_select('webform_attributes', 'wa')
->fields('wa', array(
'attributes',
))
->condition('nid', $nid, '=')
->execute()
->fetchField();
if (!empty($result)) {
$result = unserialize($result);
if ($parser) {
return _webform_attributes_parser_array_to_string($result);
}
return $result;
}
return NULL;
}