PHPackages                             potagercity/salesforce-soap-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. potagercity/salesforce-soap-client

ActiveLibrary[API Development](/categories/api)

potagercity/salesforce-soap-client
==================================

A client for the Salesforce SOAP API

2.0.3(2y ago)01.5kMITPHPPHP &gt;=7.4

Since Apr 5Pushed 2y agoCompare

[ Source](https://github.com/hyptos/salesforce-soap-client)[ Packagist](https://packagist.org/packages/potagercity/salesforce-soap-client)[ RSS](/packages/potagercity-salesforce-soap-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (25)Used By (0)

A PHP client for the Salesforce SOAP API
========================================

[](#a-php-client-for-the-salesforce-soap-api)

[![Release](https://camo.githubusercontent.com/7e0cd58855a4b0620fc416cd08127d49a8db5e862dcf10adcdc747edd0db6862/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f7068702d617273656e616c2f73616c6573666f7263652d736f61702d636c69656e74)](https://github.com/php-arsenal/salesforce-soap-client/releases)[![CI](https://camo.githubusercontent.com/bdea12439cf8955c5d701965ac8beb50923df21b3ac13a4eae0df0b5a1812571/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f7068702d617273656e616c2f73616c6573666f7263652d736f61702d636c69656e742f4349)](https://github.com/php-arsenal/salesforce-soap-client/actions/workflows/ci.yml)[![Packagist](https://camo.githubusercontent.com/7a146ed8e48665f339770eb2e13120a252833be6202420b970da8f9742d2996d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068702d617273656e616c2f73616c6573666f7263652d736f61702d636c69656e74)](https://packagist.org/packages/php-arsenal/salesforce-soap-client)

Introduction
------------

[](#introduction)

This library is a client for the [Salesforce SOAP API](http://www.salesforce.com/us/developer/docs/api/index.htm), and intended as a replacement for the [Force.com Tookit for PHP](http://wiki.developerforce.com/page/Force.com_Toolkit_for_PHP).

### Features

[](#features)

This library’s features include the following.

- Automatic conversion between PHP and SOAP date and datetime objects.
- Automatic conversion of Salesforce (UTC) times to your local timezone.
- Easily extensible through events: add custom logging, caching, error handling etc.
- Iterating over large results sets that require multiple calls to the API is easy through the record iterator.
- The BulkSaver helps you stay within your Salesforce API limits by using bulk creates, deletes, updates and upserts.
- Use the client in conjunction with the Symfony [Mapper Bundle](https://github.com/php-arsenal/salesforce-mapper-bundle)to get even easier access to your Salesforce data.

Installation
------------

[](#installation)

`composer require php-arsenal/salesforce-soap-client`

Usage
-----

[](#usage)

### The client

[](#the-client)

Use the client to query and manipulate your organisation’s Salesforce data. First construct a client using the builder:

```
$builder = new \PhpArsenal\SoapClient\ClientBuilder(
  '/path/to/your/salesforce/wsdl/sandbox.enterprise.wsdl.xml',
  'username',
  'password',
  'security_token'
);

$client = $builder->build();
```

### SOQL queries

[](#soql-queries)

```
$results = $client->query('select Name, SystemModstamp from Account limit 5');
```

This will fetch five accounts from Salesforce and return them as a `RecordIterator`. You can now iterate over the results. The account’s `SystemModstamp` is returned as a `\DateTime` object:

```
foreach ($results as $account) {
    echo 'Last modified: ' . $account->SystemModstamp->format('Y-m-d H:i:') . "\n";
}
```

### One-to-many relations (subqueries)

[](#one-to-many-relations-subqueries)

Results from [subqueries](http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_soql_select.htm)are themselves returned as record iterators. So:

```
$accounts = $client->query(
    'select Id, (select Id, Name from Contacts) from Account limit 10'
);

foreach ($accounts as $account) {
    if (isset($account->Contacts)) {
        foreach ($account->Contacts as $contact) {
            echo sprintf("Contact %s has name %s\n", $contact->Id, $contact->Name);
        }
    }
}
```

### Fetching large numbers of records

[](#fetching-large-numbers-of-records)

If you issue a query that returns over 2000 records, only the first 2000 records will be returned by the Salesforce API. Using the `queryLocator`, you can then fetch the following results in batches of 2000. The record iterator does this automatically for you:

```
$accounts = $client->query('Select Name from Account');
echo $accounts->count() . ' accounts returned';
foreach ($accounts as $account) {
    // This will iterate over the 2000 first accounts, then fetch the next 2000
    // and iterate over these, etc. In the end, all your organisations’s accounts
    // will be iterated over.
}
```

### Logging

[](#logging)

To enable logging for the client, call `withLog()` on the builder. For instance when using [Monolog](https://github.com/Seldaek/monolog):

```
$log = new \Monolog\Logger('name');
$log->pushHandler(new \Monolog\Handler\StreamHandler('path/to/your.log'));

$builder = new \PhpArsenal\SoapClient\ClientBuilder(
  '/path/to/your/salesforce/wsdl/sandbox.enterprise.wsdl.xml',
  'username',
  'password',
  'security_token'
);
$client = $builder->withLog($log)
  ->build();
```

All requests to the Salesforce API, as well as the responses and any errors that it returns, will now be logged.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 73.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~139 days

Recently: every ~218 days

Total

23

Last Release

988d ago

Major Versions

0.4.0 → 2.0.02021-04-12

PHP version history (3 changes)0.1.0PHP &gt;=5.3.0

0.1.8PHP &gt;=7.2

0.4.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/4549bbd0738ce1e632c1a195091bc164b5e027b0dab7faeb671389587f4a8dcb?d=identicon)[potagercity](/maintainers/potagercity)

---

Top Contributors

[![ddeboer](https://avatars.githubusercontent.com/u/89267?v=4)](https://github.com/ddeboer "ddeboer (99 commits)")[![Gyvastis](https://avatars.githubusercontent.com/u/3257577?v=4)](https://github.com/Gyvastis "Gyvastis (18 commits)")[![hyptos](https://avatars.githubusercontent.com/u/1622722?v=4)](https://github.com/hyptos "hyptos (4 commits)")[![christiaan](https://avatars.githubusercontent.com/u/118490?v=4)](https://github.com/christiaan "christiaan (3 commits)")[![Dirk-Scholten](https://avatars.githubusercontent.com/u/36883969?v=4)](https://github.com/Dirk-Scholten "Dirk-Scholten (3 commits)")[![simonharris](https://avatars.githubusercontent.com/u/385725?v=4)](https://github.com/simonharris "simonharris (3 commits)")[![j-d](https://avatars.githubusercontent.com/u/1140726?v=4)](https://github.com/j-d "j-d (1 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (1 commits)")[![shaunhardy](https://avatars.githubusercontent.com/u/993596?v=4)](https://github.com/shaunhardy "shaunhardy (1 commits)")[![ikrasnykh](https://avatars.githubusercontent.com/u/532166?v=4)](https://github.com/ikrasnykh "ikrasnykh (1 commits)")

---

Tags

soapcrmsalesforceforce.comweb services

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/potagercity-salesforce-soap-client/health.svg)

```
[![Health](https://phpackages.com/badges/potagercity-salesforce-soap-client/health.svg)](https://phpackages.com/packages/potagercity-salesforce-soap-client)
```

###  Alternatives

[phpforce/soap-client

A PHP client for the Salesforce SOAP API

831.9M1](/packages/phpforce-soap-client)[freshcells/soap-client-bundle

SoapClientBundle for symfony

35151.0k](/packages/freshcells-soap-client-bundle)[davispeixoto/laravel5-salesforce

Laravel 5 Salesforce Force.com PHP Toolkit port

47142.8k1](/packages/davispeixoto-laravel5-salesforce)[ddeboer/salesforce-mapper-bundle

A Salesforce API mapper

2835.2k](/packages/ddeboer-salesforce-mapper-bundle)[davispeixoto/laravel-salesforce

Laravel 4 Salesforce Force.com PHP Toolkit port

1433.1k](/packages/davispeixoto-laravel-salesforce)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
