/** * @param Account $account * @internal param $accessToken * @internal param $refreshToken * @return RestApi */ protected function getApi(Account $account) { /** @var RestApi $gaApi */ $gaApi = $this->container->get('ex_google_analytics.rest_api'); $gaApi->getApi()->setCredentials($account->getAccessToken(), $account->getRefreshToken()); $extractor = new Extractor($gaApi, $this->logger, $this->temp); $extractor->setConfiguration($this->getConfiguration()); $extractor->setCurrAccountId($account->getAccountId()); $gaApi->getApi()->setRefreshTokenCallback([$extractor, 'refreshTokenCallback']); $gaApi->getApi()->setBackoffCallback403($extractor->getBackoffCallback403()); return $gaApi; }
public function execute(Job $job) { $this->extractor->setConfiguration($this->initConfiguration()); return $this->extractor->run($job->getParams()); }