DateRecurOccurrencesComputed.php in Recurring Dates Field 3.x
Same filename and directory in other branches
Namespace
Drupal\date_recur\Plugin\FieldFile
src/Plugin/Field/DateRecurOccurrencesComputed.phpView source
<?php
declare (strict_types=1);
namespace Drupal\date_recur\Plugin\Field;
use Drupal\Core\TypedData\Plugin\DataType\ItemList;
/**
* Provides values for the computed 'occurrences' property on date recur fields.
*
* Usage:
* @code
* $entity->field_myfield->occurrences
* @endcode
*
* @method FieldType\DateRecurItem getParent()
*/
class DateRecurOccurrencesComputed extends ItemList {
/**
* {@inheritdoc}
*
* @yield \Generator
* An occurrence generator.
*/
public function getValue($langcode = NULL) : \Generator {
yield from $this
->getParent()
->getHelper()
->generateOccurrences();
}
}
Classes
Name | Description |
---|---|
DateRecurOccurrencesComputed | Provides values for the computed 'occurrences' property on date recur fields. |