Something went wrong. Try again.
Element Exporter makes exporting data from your Craft CMS website easy and repeatable, with events for custom data parsing and elements.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859<?php
namespace studioespresso\exporter\models;
use craft\elements\Category;
class ExportableCategoryModel extends ExportableElementTypeModel{ /** * References the class of the Element Type * @var string */ public $elementType = Category::class;
/** * Label of the element type * @var string */ public string $elementLabel = "Categories";
public bool $shouldBeLocalised = true;
/** * This function defines the element's attributes you want to make exportable * @return array */ public function getElementAttributes(): bool|array { return [ 'id' => 'ID', 'title' => 'Title', 'url' => 'URL', 'slug' => 'Slug', ]; } /** * This function defines the groups in which the element can be groups. Like sections for entries, forms for submissions , etc * @return array */ public function getGroup(): array { return [ "parameter" => "groupId", "label" => "Group", "instructions" => "Choose a group from which you want to start your export", "items" => \Craft::$app->getCategories()->getEditableGroups(), ]; }
/** * If the element's groups have an additional sub-group, define those here * @return bool|array */ public function getSubGroup(): bool|array { return false; }}