protected function DateRecurBasicFormatter::getOccurrences in Recurring Dates Field 8.2
Same name and namespace in other branches
- 3.x src/Plugin/Field/FieldFormatter/DateRecurBasicFormatter.php \Drupal\date_recur\Plugin\Field\FieldFormatter\DateRecurBasicFormatter::getOccurrences()
- 3.0.x src/Plugin/Field/FieldFormatter/DateRecurBasicFormatter.php \Drupal\date_recur\Plugin\Field\FieldFormatter\DateRecurBasicFormatter::getOccurrences()
- 3.1.x src/Plugin/Field/FieldFormatter/DateRecurBasicFormatter.php \Drupal\date_recur\Plugin\Field\FieldFormatter\DateRecurBasicFormatter::getOccurrences()
Get the occurrences for a field item.
Occurrences are abstracted out to make it easier for extending formatters to change.
Parameters
\Drupal\date_recur\Plugin\Field\FieldType\DateRecurItem $item: A field item.
int $maxOccurrences: Maximum number of occurrences to render.
Return value
\Drupal\date_recur\DateRange[] A render array.
1 call to DateRecurBasicFormatter::getOccurrences()
- DateRecurBasicFormatter::viewItem in src/
Plugin/ Field/ FieldFormatter/ DateRecurBasicFormatter.php - Generate the output appropriate for a field item.
File
- src/
Plugin/ Field/ FieldFormatter/ DateRecurBasicFormatter.php, line 447
Class
- DateRecurBasicFormatter
- Basic recurring date formatter.
Namespace
Drupal\date_recur\Plugin\Field\FieldFormatterCode
protected function getOccurrences(DateRecurItem $item, $maxOccurrences) : array {
$start = new \DateTime('now');
return $item
->getHelper()
->getOccurrences($start, NULL, $maxOccurrences);
}