You are here

function oa_export_get_comments in Open Atrium Export 7.2

Finds all comments for a given node.

Parameters

int $nid: The node id you want to find comments for.

Return value

mixed The comment ids.

1 call to oa_export_get_comments()
oa_export_comments_export in menus/oa_export.menus.export.inc
Helper function to export comments on entities.

File

./oa_export.module, line 171

Code

function oa_export_get_comments($nid) {
  if (module_exists('comment')) {
    $comments = db_select('comment', 'c')
      ->fields('c', array(
      'cid',
      'nid',
    ))
      ->condition('nid', $nid, '=')
      ->execute()
      ->fetchAllKeyed();
    return array_keys($comments);
  }
  else {
    return array();
  }
}