3 namespace Drupal\entityqueue_test\Plugin\EntityQueueHandler;
5 use Drupal\Core\Form\FormStateInterface;
6 use Drupal\entityqueue\EntityQueueHandlerBase;
9 * Defines an entity queue handler for testing.
11 * @EntityQueueHandler(
13 * title = @Translation("Test handler")
16 class Test extends EntityQueueHandlerBase {
21 public function supportsMultipleSubqueues() {
28 public function hasAutomatedSubqueues() {
35 public function defaultConfiguration() {
44 public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
46 '#type' => 'textfield',
48 '#default_value' => $this->configuration['shape'],
56 public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
57 if ($form_state->getValue('shape') === 'square') {
58 $form_state->setErrorByName('shape', $this->t('The shape can not be square.'));
65 public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
66 $this->configuration['shape'] = $form_state->getValue('shape');