You are here

function oa_clone_get_section_content in Open Atrium Clone 7.2

Gets all the content within a particular Section.

Parameters

int $nid: The node ID of the Section.

boolean $bypass_access_check: (Optional) If TRUE, it will bypass normal access checks.

Return value

array An array of node IDs.

2 calls to oa_clone_get_section_content()
oa_clone_batch_clone_section_content in ./oa_clone.module
Callback for cloning all the content in a section.
_oa_clone_batch_space in ./oa_clone.module
Recursively clone a Space while setting up a batch for cloning content.

File

./oa_clone.module, line 465

Code

function oa_clone_get_section_content($nid, $bypass_access_check = FALSE) {
  $query = new EntityFieldQuery();
  $query
    ->entityCondition('entity_type', 'node')
    ->fieldCondition('oa_section_ref', 'target_id', $nid);
  if ($bypass_access_check) {
    $query
      ->addTag('DANGEROUS_ACCESS_CHECK_OPT_OUT');
  }
  else {
    $query
      ->propertyCondition('status', 1);
  }
  $result = $query
    ->execute();
  if (isset($result['node'])) {
    return array_keys($result['node']);
  }
  return array();
}