getExtensionById('taoDelivery'); $oldService = $ext->getConfig(ServiceProxy::CONFIG_KEY); $persistenceOption = $oldService->getOption($oldService::OPTION_PERSISTENCE); $newService = new KeyValueService([ KeyValueService::OPTION_PERSISTENCE => $persistenceOption, ]); /** @var DeliveryMonitoringService $deliveryMonitoringService */ $deliveryMonitoringService = $this->getServiceManager()->get(DeliveryMonitoringService::CONFIG_ID); $deliveryExecutionsData = $deliveryMonitoringService->find( [ ['start_time' => '>0'] ] ); $method = new \ReflectionMethod(get_class($newService), 'addDeliveryToUserExecutionList'); $method->setAccessible(true); foreach ($deliveryExecutionsData as $deliveryExecutionData) { $data = $deliveryExecutionData->get(); $method->invoke($newService, $data[DeliveryMonitoringService::TEST_TAKER], $data[DeliveryMonitoringService::DELIVERY_ID], $data[DeliveryMonitoringService::DELIVERY_EXECUTION_ID]); } $ext->setConfig(ServiceProxy::CONFIG_KEY, $newService); return new common_report_Report(common_report_Report::TYPE_SUCCESS, 'Execution KV storage updated to oat\taoDelivery\model\execution\KeyValueService'); } }