src/PipelinerSales/ApiClient/PipelinerClient.php
public static function create($url, $pipelineId, $apiToken, $password)
    {
        $baseUrl = $url . '/rest_services/v1/' . $pipelineId;

        $httpClient = new CurlHttpClient();
        $httpClient->setUserCredentials($apiToken, $password);

        $dateTimeFormat = Defaults::DATE_FORMAT;
        $repoFactory = new RestRepositoryFactory($baseUrl, $httpClient, $dateTimeFormat);

        $infoMethods = new RestInfoMethods($baseUrl, $httpClient);
        $entityTypes = array_flip($infoMethods->fetchEntityPublic());

        $client = new PipelinerClient($entityTypes, $repoFactory, $infoMethods);
        return $client;
    }
public static function create($url, $pipelineId, $apiToken, $password)
    {
        $baseUrl = $url . '/rest_services/v1/' . $pipelineId;

        $httpClient = new CurlHttpClient();
        $httpClient->setUserCredentials($apiToken, $password);

        $dateTimeFormat = Defaults::DATE_FORMAT;
        $repoFactory = new RestRepositoryFactory($baseUrl, $httpClient, $dateTimeFormat);

        $infoMethods = new RestInfoMethods($baseUrl, $httpClient);
        $entityTypes = array_flip($infoMethods->fetchEntityPublic());

        $client = new PipelinerClient($entityTypes, $repoFactory, $infoMethods);
        return $client;
    }
public static function create ( $ url , $ pipelineId , $ apiToken , $ password ) { $ baseUrl = $ url . '/rest_services/v1/' . $ pipelineId ; $ httpClient = new CurlHttpClient ( ) ; $ httpClient -> setUserCredentials ( $ apiToken , $ password ) ; $ dateTimeFormat = Defaults :: DATE_FORMAT ; $ repoFactory = new RestRepositoryFactory ( $ baseUrl , $ httpClient , $ dateTimeFormat ) ; $ infoMethods = new RestInfoMethods ( $ baseUrl , $ httpClient ) ; $ entityTypes = array_flip ( $ infoMethods -> fetchEntityPublic ( ) ) ; $ client = new PipelinerClient ( $ entityTypes , $ repoFactory , $ infoMethods ) ; return $ client ; }
Creates a PipelinerClient object with sensible default configuration.
Will perform a HTTP request to fetch the existing entity types for the pipeline.

@param string $url base url of the REST server, without the trailing slash
@param string $pipelineId the unique team pipeline id
@param string $apiToken API token
@param string $password API password
@return PipelinerClient
@throws PipelinerClientException when trying to use an unsupported pipeline version
@throws PipelinerHttpException if fetching the pipeline version fails
Creates a PipelinerClient object with sensible default configuration . Will perform a HTTP request to fetch the existing entity types for the pipeline .