AdministrationLanguageNegotiationConditionBase.php in Administration Language Negotiation 8
File
src/AdministrationLanguageNegotiationConditionBase.php
View source
<?php
declare (strict_types=1);
namespace Drupal\administration_language_negotiation;
use Drupal\Core\Condition\ConditionPluginBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
abstract class AdministrationLanguageNegotiationConditionBase extends ConditionPluginBase implements AdministrationLanguageNegotiationConditionInterface, ContainerFactoryPluginInterface {
protected $weight = 0;
public function block() {
return FALSE;
}
public function evaluate() {
return $this
->execute();
}
public function getDescription() {
$definition = $this
->getPluginDefinition();
return !empty($definition['description']) ? $definition['description'] : NULL;
}
public function getName() {
$definition = $this
->getPluginDefinition();
return !empty($definition['name']) ? $definition['name'] : $this
->getPluginId();
}
public function getWeight() {
return !empty($this->weight) ? $this->weight : 0;
}
public function pass() {
return TRUE;
}
public function postConfigSave(array &$form, FormStateInterface $form_state) {
}
public function setWeight($weight) {
$this->weight = $weight;
return $this;
}
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
parent::submitConfigurationForm($form, $form_state);
$this->configuration[$this
->getPluginId()] = $form_state
->getValue($this
->getPluginId());
}
public function summary() {
}
}