You are here

protected function SetStatus::getPluginSelector in Payment 8.2

Gets the plugin selector.

Parameters

\Drupal\Core\Form\FormStateInterface $form_state:

Return value

\Drupal\plugin\Plugin\Plugin\PluginSelector\PluginSelectorInterface

File

src/Plugin/Action/SetStatus.php, line 135

Class

SetStatus
Sets a status on a payment.

Namespace

Drupal\payment\Plugin\Action

Code

protected function getPluginSelector(FormStateInterface $form_state) {
  if (!$form_state
    ->has('plugin_selector')) {
    $plugin_selector = $this->pluginSelectorManager
      ->createInstance('payment_select_list');
    $plugin_selector
      ->setSelectablePluginType($this->paymentStatusType);
    $plugin_selector
      ->setRequired();
    $plugin_selector
      ->setLabel($this
      ->t('Payment status'));
    $plugin_selector
      ->setCollectPluginConfiguration(FALSE);
    $form_state
      ->set('plugin_selector', $plugin_selector);
  }
  return $form_state
    ->get('plugin_selector');
}