PdfEngineBase.php in Entity Print 8
File
src/Plugin/PdfEngineBase.php
View source
<?php
namespace Drupal\entity_print\Plugin;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\PluginBase;
abstract class PdfEngineBase extends PluginBase implements PdfEngineInterface {
protected $pdf;
public function __construct(array $configuration, $plugin_id, $plugin_definition) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this
->setConfiguration($configuration);
}
public static function getInstallationInstructions() {
return 'Please install using composer';
}
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
return $form;
}
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
}
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
foreach ($this
->defaultConfiguration() as $key => $value) {
$this->configuration[$key] = $form_state
->getValue($key);
}
}
public function getConfiguration() {
return $this->configuration;
}
public function setConfiguration(array $configuration) {
$this->configuration = $configuration + $this
->defaultConfiguration();
}
public function defaultConfiguration() {
return [];
}
public function calculateDependencies() {
return [];
}
}