You are here

public function DateRecurPartGrid::allowParts in Recurring Dates Field 8.2

Same name and namespace in other branches
  1. 3.x src/DateRecurPartGrid.php \Drupal\date_recur\DateRecurPartGrid::allowParts()
  2. 3.0.x src/DateRecurPartGrid.php \Drupal\date_recur\DateRecurPartGrid::allowParts()
  3. 3.1.x src/DateRecurPartGrid.php \Drupal\date_recur\DateRecurPartGrid::allowParts()

Adds parts for a frequency to the allow list.

Parameters

string $frequency: A frequency.

string[] $parts: An array of parts.

File

src/DateRecurPartGrid.php, line 31

Class

DateRecurPartGrid
Frequency/part support grid.

Namespace

Drupal\date_recur

Code

public function allowParts(string $frequency, array $parts) : void {
  $existingFrequencyParts = $this->allowedParts[$frequency] ?? [];
  $this->allowedParts[$frequency] = array_merge($parts, $existingFrequencyParts);
}