self::SUPPORTED_ELEMENT_TYPES, ]); Event::trigger(self::class, self::EVENT_REGISTER_EXPORTABLE_ELEMENT_TYPES, $event); self::$_supportedElementTypes = array_merge( self::SUPPORTED_ELEMENT_TYPES, $event->elementTypes ); return self::$_supportedElementTypes; } public function getElementTypesOnly(): array { if (self::$_supportedElementTypes == null) { $this->getAvailableElementTypes(); } $types = []; foreach ($this->getAvailableElementTypes() as $model) { if (!$model->validate()) { \Craft::error("ExportableElementTypeModel is not configured correctly", Exporter::class); continue; } $types[$model->elementType] = $model->elementLabel; } return $types; } public function getElementTypeSettings($element) { $this->getAvailableElementTypes(); if (!isset(self::$_supportedElementTypes[$element])) { // throw exception here } return self::$_supportedElementTypes[$element]; } }