* @package taoDelivery */ class AssemblyExporter implements \tao_models_classes_export_ExportHandler { /** * (non-PHPdoc) * @see tao_models_classes_export_ExportHandler::getLabel() */ public function getLabel() { return __('Assembly'); } /** * (non-PHPdoc) * @see tao_models_classes_export_ExportHandler::getExportForm() */ public function getExportForm(core_kernel_classes_Resource $resource) { if ($resource instanceof core_kernel_classes_Class) { $formData = ['class' => $resource]; } else { $formData = ['instance' => $resource]; } $form = new ExportForm($formData); return $form->getForm(); } /** * (non-PHPdoc) * @see tao_models_classes_export_ExportHandler::export() */ public function export($formValues, $destination) { if (!isset($formValues['exportInstance']) || empty($formValues['exportInstance'])) { throw new \common_Exception('No instance selected'); } $delivery = new core_kernel_classes_Resource($formValues['exportInstance']); $path = ServiceManager::getServiceManager()->get(AssemblyExporterService::class)->exportCompiledDelivery($delivery); return $path; } }