/** * @param ApiMain $mainModule * @param string $moduleName * @param string $modulePrefix */ public function __construct(ApiMain $mainModule, $moduleName, $modulePrefix = '') { parent::__construct($mainModule, $moduleName, $modulePrefix); $wikibaseRepo = WikibaseRepo::getDefaultInstance(); $apiHelperFactory = $wikibaseRepo->getApiHelperFactory($this->getContext()); $changeOpFactoryProvider = $wikibaseRepo->getChangeOpFactoryProvider(); $this->errorReporter = $apiHelperFactory->getErrorReporter($this); $this->siteLinkChangeOpFactory = $changeOpFactoryProvider->getSiteLinkChangeOpFactory(); }
/** * @see ModifyEntity::__construct * * @param ApiMain $mainModule * @param string $moduleName * @param string $modulePrefix * * @throws MWException */ public function __construct(ApiMain $mainModule, $moduleName, $modulePrefix = '') { parent::__construct($mainModule, $moduleName, $modulePrefix); $wikibaseRepo = WikibaseRepo::getDefaultInstance(); $apiHelperFactory = $wikibaseRepo->getApiHelperFactory($this->getContext()); $this->termsLanguages = $wikibaseRepo->getTermsLanguages(); $this->errorReporter = $apiHelperFactory->getErrorReporter($this); $this->revisionLookup = $wikibaseRepo->getEntityRevisionLookup('uncached'); $this->idParser = $wikibaseRepo->getEntityIdParser(); $this->statementDeserializer = $wikibaseRepo->getStatementDeserializer(); $this->entityFactory = $wikibaseRepo->getEntityFactory(); $changeOpFactoryProvider = $wikibaseRepo->getChangeOpFactoryProvider(); $this->termChangeOpFactory = $changeOpFactoryProvider->getFingerprintChangeOpFactory(); $this->statementChangeOpFactory = $changeOpFactoryProvider->getStatementChangeOpFactory(); $this->siteLinkChangeOpFactory = $changeOpFactoryProvider->getSiteLinkChangeOpFactory(); }