You are here

abstract class FieldMapping in FillPDF 5.0.x

Same name and namespace in other branches
  1. 8.4 src/FieldMapping.php \Drupal\fillpdf\FieldMapping

Represents a mapping between a PDF field and a merge value.

Represents a mapping between a PDF field and a merge value (a value with which to fill in the field). This is a barebones base class intended to be subclassed and enhanced with additional properties and getter methods.

FieldMapping objects are immutable; replace the value by calling the constructor again if the value needs to change.

Hierarchy

Expanded class hierarchy of FieldMapping

2 files declare their use of FieldMapping
ImageFieldMapping.php in src/FieldMapping/ImageFieldMapping.php
TextFieldMapping.php in src/FieldMapping/TextFieldMapping.php

File

src/FieldMapping.php, line 15

Namespace

Drupal\fillpdf
View source
abstract class FieldMapping {

  /**
   * The primary value of the mapping.
   *
   * @var string
   */
  protected $data;

  /**
   * Constructs a FieldMapping object.
   *
   * @param string $data
   *   String containing the data.
   */
  public function __construct($data) {
    $this->data = $data;
  }

  /**
   * Returns the data.
   *
   * @return string
   *   String containing the data.
   */
  public function getData() {
    return $this->data;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FieldMapping::$data protected property The primary value of the mapping.
FieldMapping::getData public function Returns the data.
FieldMapping::__construct public function Constructs a FieldMapping object. 2