You are here

public function wf_crm_webform_base::getAttachments in Webform CiviCRM Integration 7.4

Same name and namespace in other branches
  1. 7.5 includes/wf_crm_webform_base.inc \wf_crm_webform_base::getAttachments()

FIXME: Use the api for this

Parameters

string $ent - entity type:

int $id - entity id:

Return value

array starting at index 1

2 calls to wf_crm_webform_base::getAttachments()
wf_crm_webform_postprocess::processAttachments in includes/wf_crm_webform_postprocess.inc
wf_crm_webform_preprocess::populateExistingEntity in includes/wf_crm_webform_preprocess.inc
Populate existing entity data

File

includes/wf_crm_webform_base.inc, line 980

Class

wf_crm_webform_base
Class wf_crm_webform_base

Code

public function getAttachments($ent, $id) {
  $n = 1;
  $attachments = array();
  $dao = CRM_Core_DAO::executeQuery("SELECT * FROM civicrm_entity_file WHERE entity_table = 'civicrm_{$ent}' AND entity_id = {$id}");
  while ($dao
    ->fetch()) {
    $attachments[$n++] = array(
      'id' => $dao->id,
      'file_id' => $dao->file_id,
    );
  }
  return $attachments;
}