getServiceManager()->get(ResourceRelationServiceProxy::SERVICE_ID); $resourceRelationService->addService('media', MediaRelationService::class); $this->getServiceManager()->register(ResourceRelationServiceProxy::SERVICE_ID, $resourceRelationService); } public function down(Schema $schema): void { /** @var ResourceRelationServiceInterface $resourceRelationService */ $resourceRelationService = $this->getServiceManager()->get(ResourceRelationServiceProxy::SERVICE_ID); $resourceRelationService->removeService('media', MediaRelationService::class); } }