*/ class SetItemModel extends InstallAction { public function __invoke($params) { $options = [ ItemModel::EXPORT_HANDLER => [ new ItemMetadataByClassExportHandler(), new ApipPackageExportHandler(), new QtiPackageExportHandler(), new QtiPackage22ExportHandler() ], ItemModel::IMPORT_HANDLER => [ new QtiItemImport(), new QtiPackageImport(), ] ]; if (\common_ext_ExtensionsManager::singleton()->getExtensionById('taoQtiItem')->hasConfig(ItemModel::COMPILER)) { $options[ItemModel::COMPILER] = \common_ext_ExtensionsManager::singleton()->getExtensionById('taoQtiItem')->getConfig(ItemModel::COMPILER); \common_ext_ExtensionsManager::singleton()->getExtensionById('taoQtiItem')->unsetConfig(ItemModel::COMPILER); } else { $options[ItemModel::COMPILER] = 'oat\\taoQtiItem\\model\\QtiItemCompiler'; } $itemModelService = new ItemModel($options); $this->getServiceManager()->propagate($itemModelService); $this->getServiceManager()->register(ItemModel::SERVICE_ID, $itemModelService); } }