Skip to content

Custom Exporters for Calendar Events #265

Discussion options

You must be logged in to vote

It should work exactly the same as your People Exporter.

Also see: https://craftcms.com/docs/5.x/extend/element-exporter-types.html

I created:

<?php

namespace namespace\foobar;

use craft\base\Element;
use craft\base\ElementExporter;
use craft\elements\db\ElementQueryInterface;

class MyCustomCalendarEventExporter extends ElementExporter
{
    public static function displayName(): string
    {
        return 'My Custom Calendar Event Exporter';
    }

    public function export(ElementQueryInterface $query): mixed
    {
        $results = [];

        foreach ($query->each() as $element) {
            /** @var Element $element */
            $results[] = [
                'Title' => $ele…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by seandelaney
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants