Test.php in Entityqueue 8
File
tests/modules/entityqueue_test/src/Plugin/EntityQueueHandler/Test.php
View source
<?php
namespace Drupal\entityqueue_test\Plugin\EntityQueueHandler;
use Drupal\Core\Form\FormStateInterface;
use Drupal\entityqueue\EntityQueueHandlerBase;
class Test extends EntityQueueHandlerBase {
public function supportsMultipleSubqueues() {
return TRUE;
}
public function hasAutomatedSubqueues() {
return FALSE;
}
public function defaultConfiguration() {
return [
'shape' => 'round',
];
}
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$form['shape'] = [
'#type' => 'textfield',
'#title' => 'Shape',
'#default_value' => $this->configuration['shape'],
];
return $form;
}
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
if ($form_state
->getValue('shape') === 'square') {
$form_state
->setErrorByName('shape', $this
->t('The shape can not be square.'));
}
}
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
$this->configuration['shape'] = $form_state
->getValue('shape');
}
}
Classes
Name |
Description |
Test |
Defines an entity queue handler for testing. |