You are here

public function NodeAccessRebuildProgressiveSettingsForm::buildForm in Node Access Rebuild Progressive 8

Same name and namespace in other branches
  1. 2.x src/Form/NodeAccessRebuildProgressiveSettingsForm.php \Drupal\node_access_rebuild_progressive\Form\NodeAccessRebuildProgressiveSettingsForm::buildForm()

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

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

Return value

array The form structure.

Overrides ConfigFormBase::buildForm

File

src/Form/NodeAccessRebuildProgressiveSettingsForm.php, line 32

Class

NodeAccessRebuildProgressiveSettingsForm
Configure settings for our module.

Namespace

Drupal\node_access_rebuild_progressive\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('node_access_rebuild_progressive.settings');
  $form['cron'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Enable progressive node access rebuild at cron time'),
    '#description' => $this
      ->t('It is recommended that you run cron via drush for using this feature.'),
    '#default_value' => $config
      ->get('cron'),
  ];
  $form['chunk'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Number of nodes to process in each chunk'),
    '#default_value' => $config
      ->get('chunk'),
    '#description' => $this
      ->t('The number of nodes that will be processed per cron run. Make sure it can safely fit in memory, and in the cron run time if you are not running cron via drush.'),
  ];
  return parent::buildForm($form, $form_state);
}