You are here

function fillpdf_fields_create_update in FillPDF 7

Create or update a mapping record in fillpdf_fields.

Wrapper for drupal_write_record().

Parameters

int $fid: The integer ID of the PDF.

string $pdf_key: The PDF-field key.

array $record: The fields of the mapping entry to create or update.

bool $update: Whether this is an update, otherwise a creation.

Return value

false|int See drupal_write_record().

6 calls to fillpdf_fields_create_update()
FillPdfMergeTestCase::testPdfMerging in tests/FillPdfMergeTestCase.test
Test PDF merging.
FillPdfTestHelper::mapFillPdfFieldsToEntityFields in tests/FillPdfTestHelper.test
Maps FillPDF fields to entity fields.
fillpdf_field_edit_submit in ./fillpdf.admin.inc
Save changes to the database.
fillpdf_import_mappings in ./fillpdf.admin.inc
Import an array of decoded FillPDF mappings.
fillpdf_parse_pdf in ./fillpdf.module
This function generates the form fields from the specified PDF.

... See full list

File

./fillpdf.module, line 1687

Code

function fillpdf_fields_create_update($fid, $pdf_key, array &$record, $update = FALSE) {

  // Ensure $record contains the primary key.
  $record['fid'] = $fid;
  $record['pdf_key'] = $pdf_key;

  // Set primary key if updating or use default for creating.
  $primary_keys = $update ? array(
    'fid',
    'pdf_key',
  ) : array();
  return drupal_write_record('fillpdf_fields', $record, $primary_keys);
}