You are here

abstract class MappedFieldBase in Pardot Integration 2.x

Provides a class for mapped fields.

Hierarchy

Expanded class hierarchy of MappedFieldBase

File

src/MappedFieldBase.php, line 8

Namespace

Drupal\pardot
View source
abstract class MappedFieldBase implements MappedFieldInterface {

  /**
   * The pardot field key to map the value to.
   *
   * @var string
   */
  protected $pardotKey;

  /**
   * The plguin Type.
   *
   * @var string
   */
  protected $pluginType;

  /**
   * The Plugin associated with this map.
   *
   * @var mixed
   */
  protected $plugin;

  /**
   * {@inheritdoc}
   */
  public function __construct(string $pardot_key = '', $plugin_type = '', $plugin = [], $config = []) {
    $this->pardotKey = $pardot_key;
    $this->pluginType = $plugin_type;
    $this->plugin = $plugin;
  }

  /**
   * {@inheritdoc}
   */
  public function getPardotKey() {
    return $this->pardotKey;
  }

  /**
   * {@inheritdoc}
   */
  public function setPardotKey($pardot_key) {
    $this->pardotKey = $pardot_key;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getPluginType() {
    return $this->pluginType;
  }

  /**
   * {@inheritdoc}
   */
  public function setPluginType(string $plugin_type) {
    $this->pluginType = $plugin_type;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getPlugin() {
    return $this->plugin;
  }

  /**
   * {@inheritdoc}
   */
  public function setPlugin($plugin) {
    $this->plugin = $plugin;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function toArray() {
    return [
      'pardot_key' => $this
        ->getPardotKey(),
      'plugin_type' => $this
        ->getPluginType(),
      'plugin' => $this
        ->getPlugin(),
      'class' => get_called_class(),
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MappedFieldBase::$pardotKey protected property The pardot field key to map the value to.
MappedFieldBase::$plugin protected property The Plugin associated with this map.
MappedFieldBase::$pluginType protected property The plguin Type.
MappedFieldBase::getPardotKey public function Get the pardot key string. Overrides MappedFieldInterface::getPardotKey
MappedFieldBase::getPlugin public function Return the plugin instance or null. Overrides MappedFieldInterface::getPlugin
MappedFieldBase::getPluginType public function Get the machine name of the option chosen for the plugin type. Overrides MappedFieldInterface::getPluginType
MappedFieldBase::setPardotKey public function Set the string for the pardot key. Overrides MappedFieldInterface::setPardotKey
MappedFieldBase::setPlugin public function Set the instance of the plugin for this MappedField. Overrides MappedFieldInterface::setPlugin
MappedFieldBase::setPluginType public function Set the machine name of the plugin_type chosen. Overrides MappedFieldInterface::setPluginType 1
MappedFieldBase::toArray public function Returns an array representation of the segment. Overrides MappedFieldInterface::toArray
MappedFieldBase::__construct public function Constructs a new MappedField. Overrides MappedFieldInterface::__construct 1