public function PardotClient::__construct in Pardot Integration 2.x
PersonifySsoClient constructor.
Parameters
\Drupal\Core\Config\ConfigFactory $configFactory: The config factory service.
\Drupal\Core\Logger\LoggerChannelFactoryInterface $logger_factory: Logger channel factory.
\GuzzleHttp\Client $http_client: HTTP client.
\Drupal\Core\State\StateInterface $state: State storage.
\Drupal\Core\StringTranslation\TranslationInterface $string_translation: Translation.
\Drupal\Component\Datetime\TimeInterface $time: Time service.
\Drupal\salesforce\SalesforceAuthProviderPluginManagerInterface $authManager: Auth manager service.
File
- src/
Service/ PardotClient.php, line 107
Class
- PardotClient
- Provides methods to execute Pardot API operations.
Namespace
Drupal\pardot\ServiceCode
public function __construct(ConfigFactory $configFactory, LoggerChannelFactoryInterface $logger_factory, Client $http_client, StateInterface $state, TranslationInterface $string_translation, TimeInterface $time, SalesforceAuthProviderPluginManagerInterface $authManager) {
$this->configFactory = $configFactory;
$this->pardotSettings = $this->configFactory
->get('pardot.settings');
$this->apibaseUrl = $this->pardotSettings
->get('api_url');
$this->businessId = $this->pardotSettings
->get('salesforce_pardot_business_unit_id');
$this->logger = $logger_factory
->get('pardot');
$this->httpClient = $http_client;
$this->state = $state;
$this->stringTranslation = $string_translation;
$this->time = $time;
$this->authManager = $authManager;
$auth_providers = $authManager
->getProviders();
$selected_auth_provider = $this->pardotSettings
->get('salesforce_auth_provider');
$this->authProvider = !empty($auth_providers[$selected_auth_provider]) ? $auth_providers[$selected_auth_provider] : FALSE;
$this->authConfig = $authManager
->getConfig();
$this->authToken = $authManager
->getToken();
}