You are here

interface SerializerInterface in FillPDF 8.4

Same name and namespace in other branches
  1. 5.0.x src/SerializerInterface.php \Drupal\fillpdf\SerializerInterface

Interface SerializerInterface.

@package Drupal\fillpdf

Hierarchy

Expanded class hierarchy of SerializerInterface

All classes that implement SerializerInterface

3 files declare their use of SerializerInterface
FillPdfFormExportForm.php in src/Form/FillPdfFormExportForm.php
FillPdfFormForm.php in src/Form/FillPdfFormForm.php
FillPdfFormImportForm.php in src/Form/FillPdfFormImportForm.php

File

src/SerializerInterface.php, line 10

Namespace

Drupal\fillpdf
View source
interface SerializerInterface {

  /**
   * Serializes a FillPDF form for export.
   *
   * @param \Drupal\fillpdf\FillPdfFormInterface $fillpdf_form
   *   The FillPDF Form to serialize.
   *
   * @return string
   *   The serialized FillPDF form.
   */
  public function getFormExportCode(FillPdfFormInterface $fillpdf_form);

  /**
   * Deserializes a serialized FillPDF form for import.
   *
   * @param string $code
   *   The serialized FillPDF form.
   *
   * @return array
   *   Associative array containing the deserialized FillPDF form object keyed
   *   with 'form' and an array of deserialized FillPDF form objects keyed
   *   with 'fields'.
   */
  public function deserializeForm($code);

  /**
   * Imports a FillPDF form..
   *
   * @param \Drupal\fillpdf\FillPdfFormInterface $fillpdf_form
   *   The existing FillPDF form.
   * @param \Drupal\fillpdf\FillPdfFormInterface $imported_form
   *   The FillPDF form being imported, usually from import code.
   * @param \Drupal\fillpdf\FillPdfFormFieldInterface[] $imported_fields
   *   Array of FillPDF form objects to import.
   *
   * @return string[]
   *   Array of unmatched PDF keys.
   */
  public function importForm(FillPdfFormInterface $fillpdf_form, FillPdfFormInterface $imported_form, array $imported_fields);

  /**
   * Imports FillPDF form fields.
   *
   * Overwrites empty field values with previous existing field values.
   *
   * @param \Drupal\fillpdf\FillPdfFormFieldInterface[] $keyed_fields
   *   Associative array of unsaved FillPDF Form objects keyed by PDF key.
   * @param \Drupal\fillpdf\FillPdfFormFieldInterface[] $existing_fields
   *   (optional) Array of existing PDF keys.
   * @param bool $save_existing_fields
   *   Whether to save the form fields in $existing_fields after updating them.
   *   If you pass FALSE, you will have to save them yourself.
   *
   * @return string[]
   *   Array of unmatched PDF keys.
   */
  public function importFormFields(array $keyed_fields, array &$existing_fields = [], $save_existing_fields = TRUE) : array;

}

Members

Namesort descending Modifiers Type Description Overrides
SerializerInterface::deserializeForm public function Deserializes a serialized FillPDF form for import. 1
SerializerInterface::getFormExportCode public function Serializes a FillPDF form for export. 1
SerializerInterface::importForm public function Imports a FillPDF form.. 1
SerializerInterface::importFormFields public function Imports FillPDF form fields. 1