public function DateRecurPartGrid::isFrequencyAllowed in Recurring Dates Field 3.x
Same name and namespace in other branches
- 8.2 src/DateRecurPartGrid.php \Drupal\date_recur\DateRecurPartGrid::isFrequencyAllowed()
- 3.0.x src/DateRecurPartGrid.php \Drupal\date_recur\DateRecurPartGrid::isFrequencyAllowed()
- 3.1.x src/DateRecurPartGrid.php \Drupal\date_recur\DateRecurPartGrid::isFrequencyAllowed()
Determines whether a frequency and at least one part is supported.
Parameters
string $frequency: A frequency.
Return value
bool Whether a frequency is supported.
File
- src/
DateRecurPartGrid.php, line 52
Class
- DateRecurPartGrid
- Frequency/part support grid.
Namespace
Drupal\date_recurCode
public function isFrequencyAllowed(string $frequency) : bool {
assert(in_array($frequency, DateRecurRruleMap::FREQUENCIES, TRUE));
if ($this
->isAllowEverything()) {
return TRUE;
}
return isset($this->allowedParts[$frequency]) && count($this->allowedParts[$frequency]) > 0;
}