ProductImportExportFormTrait
"Catalog export" form on `show`: a learning aid for the import format (languages + sections + `includeIds`), always over the whole catalog. There is no category choice; the `ProductSet`/`Product` grids do that more precisely with their own filters and the bulk action "export to XML" (see {@see \App\UI\Admin\Eshop\Presenters\Traits\CatalogExportDownloadTrait}). The scope is deliberately limited to `ApiProductXmlExporter::DEFAULT_LIMIT` cards, the generator's safe cap, so the form never promises more than the export outputs.
The form lives in a modal opened by the "Export catalog" button in the show header (template
ProductImport/show.latte). It is submitted as a full POST, not Naja, because the response is a file
download. The gate is self::CATALOG_EXPORT_PRIVILEGE: the same privilege without which the Api
export() would reject the call, and the template does not render the button without it.
Table of Contents
Constants
- CATALOG_EXPORT_PRIVILEGE : string = ':Api:Eshop:ProductImport:export'
- Privilege key of the catalog export. The admin has no own key for it (`:Admin:Eshop:Product(Set):export` belongs to grid bulk actions), so the form checks the Api key `:Api:Eshop:ProductImport:export`; the template button and the processing check the same key.
Properties
Methods
Constants
CATALOG_EXPORT_PRIVILEGE
Privilege key of the catalog export. The admin has no own key for it (`:Admin:Eshop:Product(Set):export` belongs to grid bulk actions), so the form checks the Api key `:Api:Eshop:ProductImport:export`; the template button and the processing check the same key.
public
string
CATALOG_EXPORT_PRIVILEGE
= ':Api:Eshop:ProductImport:export'
Properties
$catalogLanguageManager
public
LanguageManager
$catalogLanguageManager
Attributes
- #[Inject]
$catalogProductManager
public
ProductManager
$catalogProductManager
Attributes
- #[Inject]
Methods
onCatalogExportFormSuccess()
public
onCatalogExportFormSuccess(Form $form, ArrayHash $values) : void
Parameters
- $form : Form
- $values : ArrayHash
createComponentCatalogExportForm()
protected
createComponentCatalogExportForm() : Form