Skip to content

Update Partner #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 38 commits into
base: partner
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
25da1e9
Reduce WSDL caching
ddeboer May 28, 2013
7d604e0
Make id field public
ddeboer May 28, 2013
3e5d019
Add phpdoc
ddeboer May 28, 2013
21fe2b1
Make seek() return record
ddeboer May 28, 2013
b52bcb7
Fix event constant values
ddeboer May 29, 2013
8675df7
Fix test
ddeboer May 29, 2013
9fa181b
Add installation to README
ddeboer May 29, 2013
a682733
Update description
ddeboer Jun 7, 2013
821ddaa
Add logging plugin
ddeboer Jul 13, 2013
f7492f4
Fix PHPDoc
ddeboer Jul 13, 2013
a5aaa3a
Update README.md
ddeboer Jul 13, 2013
8112fe1
Update README.md
ddeboer Jul 13, 2013
5eee020
Use the UpsertResult class so we can check if it was a update or insert
christiaan Aug 9, 2013
dbc4d72
Fix typehint for upsert method
christiaan Aug 9, 2013
98ce363
Type Hinting improvements
christiaan Aug 12, 2013
e003174
Merge pull request #5 from christiaan/type_hints
ddeboer Aug 23, 2013
200ad47
Merge pull request #6 from christiaan/upsert_result
ddeboer Aug 23, 2013
2c88b3c
composer json update
Jan 9, 2014
e0ee205
Merge pull request #8 from polidog/composer
ddeboer Jan 9, 2014
d9327e1
Fixed variable scoping issue which can lead to out of memory error.
shaunhardy Jun 12, 2014
9f014c8
Merge pull request #9 from shaunhardy/master
ddeboer Jun 13, 2014
7adcbbd
Added PHP 5.6, 5.5 and HHVM to travis.yml
Nyholm Jul 16, 2014
4b56075
Update README.md
simonharris Sep 25, 2014
ed434a5
Update README.md
simonharris Sep 25, 2014
13b6aff
Allow passing an array of user-specified options to SoapClient
Sep 25, 2014
fdb14c2
Prevent stripping Id field to fix update()
simonharris Nov 6, 2014
dd83efb
Fixed issue with "my" instances
j-d Nov 24, 2014
8613fc5
Merge pull request #15 from j-d/patch-1
ddeboer Nov 24, 2014
2d397ad
Merge pull request #10 from Nyholm/patch-1
ddeboer Nov 24, 2014
9a17e51
Merge pull request #14 from simonharris/master
ddeboer Apr 5, 2015
88a4b23
Add Scrutinizer badge
ddeboer Apr 5, 2015
7dab82f
Replace Travis badge with SVG version
ddeboer Apr 5, 2015
1cdfd11
Fix: Issues upserting by ID and specifying nillable fields
ikrasnykh Apr 4, 2015
df1d065
Merge pull request #19 from technweb/master
ddeboer Apr 5, 2015
60d2e84
Introduce phpunit to repo and composer.lock. Fix/update tests. Add gi…
Aug 10, 2017
7e91ce9
Merge pull request #1 from milesnash/feature/introduce-phpunit-fix-tests
milesnash Aug 10, 2017
0e807f5
Merge branch 'master' into partner
Aug 10, 2017
8224fd1
Update tests
Aug 10, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/vendor
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ language: php
php:
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm

env:
- SYMFONY_VERSION="2.1.*"

before_script:
- wget http://getcomposer.org/composer.phar
- php composer.phar install
- php composer.phar install
108 changes: 106 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
[![Build Status](https://secure.travis-ci.org/phpforce/soap-client.png?branch=master)](http://travis-ci.org/phpforce/soap-client)
[![Build Status](https://travis-ci.org/phpforce/soap-client.svg?branch=master)](https://travis-ci.org/phpforce/soap-client)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/phpforce/soap-client/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/phpforce/soap-client/?branch=master)

###[I’m looking for maintainers!](https://github.com/phpforce/soap-client/issues/4)


PHPForce Soap Client: a PHP client for the Salesforce SOAP API
==============================================================
Expand All @@ -25,4 +29,104 @@ This library’s features include the following.
* Completely unit tested (still working on that one).
* Use the client in conjunction with the Symfony2
[Mapper Bundle](https://github.com/ddeboer/DdeboerSalesforceMapperBundle)
to get even easier access to your Salesforce data.
to get even easier access to your Salesforce data.

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

This library is available on [Packagist](http://packagist.org/packages/phpforce/soap-client).
The recommended way to install this library is through [Composer](http://getcomposer.org):

```bash
$ php composer.phar require phpforce/soap-client dev-master
```

Usage
-----

### The client

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

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

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

### SOQL queries

```php
$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:

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

### 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:

```php
$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

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:

```php
$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

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

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

$builder = new \Phpforce\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.
13 changes: 8 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "phpforce/soap-client",
"type": "library",
"description": "Use the Salesforce SOAP API from PHP",
"description": "A PHP client for the Salesforce SOAP API",
"keywords": [ "salesforce", "crm", "soap", "force.com", "web services" ],
"license": "MIT",
"authors": [
Expand All @@ -13,17 +13,20 @@
],
"require": {
"php": ">=5.3.0",
"phpforce/common": "dev-master"
"phpforce/common": "dev-master",
"psr/log": "*"
},
"require-dev": {
"doctrine/common": "2.3@stable"
"doctrine/common": ">=2.3",
"phpunit/phpunit": "^6.3"
},
"suggest": {
"doctrine/common": "For caching SOAP responses"
"doctrine/common": "For caching SOAP responses",
"monolog/monolog": "For logging SOAP transactions"
},
"autoload": {
"psr-0": {
"Phpforce\\SoapClient": "src"
}
}
}
}
Loading