/** * @param Account $account * @return RestApi */ protected function getApi(Account $account) { /** @var RestApi $googleDriveApi */ $googleDriveApi = $this->container->get('ex_google_drive.rest_api'); $googleDriveApi->getApi()->setCredentials($account->getAccessToken(), $account->getRefreshToken()); $this->extractor = $this->container->get('ex_google_drive.extractor'); $this->extractor->setConfiguration($this->getConfiguration()); $this->extractor->setCurrAccountId($account->getAccountId()); $googleDriveApi->getApi()->setRefreshTokenCallback([$this->extractor, 'refreshTokenCallback']); return $googleDriveApi; }
public function execute(Job $job) { $this->extractor->setConfiguration($this->initConfiguration()); return $this->extractor->run($job->getParams()); }