You are here

public function ViewsIcalHelper::addEvent in Views iCal 8

Adds an event.

This is used when the date_field type is `datetime` or `daterange`.

Parameters

\Eluceo\iCal\Component\Event[] $events: Set of events where the new event will be added.

\Drupal\Core\Entity\ContentEntityInterface $entity: The entity to be used for creating the event.

\DateTimeZone $timezone: Timezone data to be specified to the event.

array $field_mapping: Views field option and entity field name mapping. Example: [ 'date_field' => 'field_event_date', 'summary_field' => 'field_event_summary', 'description_field' => 'field_event_description', ] End of example.

Throws

\Exception Throws exception if it fails to parse the datetime data from entity.

Overrides ViewsIcalHelperInterface::addEvent

See also

\Drupal\views_ical\Plugin\views\style\Ical::defineOptions

File

src/ViewsIcalHelper.php, line 273

Class

ViewsIcalHelper
Helper methods for views_ical.

Namespace

Drupal\views_ical

Code

public function addEvent(array &$events, ResultRow $row, \DateTimeZone $timezone, array $field_mapping) : void {

  // All code moved to field-specific methods.
}