MappedFieldBase.php in Pardot Integration 2.x
File
src/MappedFieldBase.php
View source
<?php
namespace Drupal\pardot;
abstract class MappedFieldBase implements MappedFieldInterface {
protected $pardotKey;
protected $pluginType;
protected $plugin;
public function __construct(string $pardot_key = '', $plugin_type = '', $plugin = [], $config = []) {
$this->pardotKey = $pardot_key;
$this->pluginType = $plugin_type;
$this->plugin = $plugin;
}
public function getPardotKey() {
return $this->pardotKey;
}
public function setPardotKey($pardot_key) {
$this->pardotKey = $pardot_key;
return $this;
}
public function getPluginType() {
return $this->pluginType;
}
public function setPluginType(string $plugin_type) {
$this->pluginType = $plugin_type;
return $this;
}
public function getPlugin() {
return $this->plugin;
}
public function setPlugin($plugin) {
$this->plugin = $plugin;
return $this;
}
public function toArray() {
return [
'pardot_key' => $this
->getPardotKey(),
'plugin_type' => $this
->getPluginType(),
'plugin' => $this
->getPlugin(),
'class' => get_called_class(),
];
}
}