You are here

public function QuickNodeCloneEntitySettingsForm::getDescription in Quick Node Clone 8

Returns the description field.

Parameters

Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

string The description text.

Overrides QuickNodeCloneEntitySettingsFormInterface::getDescription

1 call to QuickNodeCloneEntitySettingsForm::getDescription()
QuickNodeCloneEntitySettingsForm::buildForm in src/Form/QuickNodeCloneEntitySettingsForm.php
Form constructor.

File

src/Form/QuickNodeCloneEntitySettingsForm.php, line 239

Class

QuickNodeCloneEntitySettingsForm
Abstract class to configure how entities are cloned.

Namespace

Drupal\quick_node_clone\Form

Code

public function getDescription(FormStateInterface $form_state) {
  $desc = $this
    ->t('No content types selected');
  $config_name = 'exclude.' . $this
    ->getEntityTypeId();
  if (!empty($form_state
    ->getValue('bundle_names')) && array_filter($form_state
    ->getValue('bundle_names'))) {
    $desc = '';
  }
  elseif (!empty($this
    ->getSettings($config_name)) && array_filter($this
    ->getSettings($config_name))) {
    $desc = '';
  }
  return $desc;
}