LingotekConfigFormBase.php in Lingotek Translation 8.2
File
src/Form/LingotekConfigFormBase.php
View source
<?php
namespace Drupal\lingotek\Form;
use Drupal\Core\Routing\UrlGeneratorInterface;
use Drupal\Core\Utility\LinkGeneratorInterface;
use Drupal\lingotek\LingotekInterface;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Form\ConfigFormBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
abstract class LingotekConfigFormBase extends ConfigFormBase {
public function __construct(LingotekInterface $lingotek, ConfigFactoryInterface $config, UrlGeneratorInterface $url_generator = NULL, LinkGeneratorInterface $link_generator = NULL) {
parent::__construct($config);
$this->lingotek = $lingotek;
if (!$url_generator) {
@trigger_error('The url_generator service must be passed to LingotekConfigFormBase::__construct, it is required before Lingotek 9.x-1.0.', E_USER_DEPRECATED);
$url_generator = \Drupal::service('url_generator');
}
$this->urlGenerator = $url_generator;
if (!$link_generator) {
@trigger_error('The link_generator service must be passed to LingotekConfigFormBase::__construct, it is required before Lingotek 9.x-1.0.', E_USER_DEPRECATED);
$link_generator = \Drupal::service('link_generator');
}
$this->linkGenerator = $link_generator;
}
public static function create(ContainerInterface $container) {
return new static($container
->get('lingotek'), $container
->get('config.factory'), $container
->get('url_generator'), $container
->get('link_generator'));
}
public function getEditableConfigNames() {
return [];
}
}