Download the PHP package eventfarm/restforcephp without Composer
On this page you can find all versions of the php package eventfarm/restforcephp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package restforcephp
Restforce PHP
This is meant to emulate what the ejhomes/restforce gem is doing for rails.
Installation
This library requires PHP 7.1 or later; we recommend using the latest available version of PHP. It has been test through the latest version of PHP (v8.3 as of this writing)
Or.
Add the following lines to your composer.json
file.
Project Defaults
Access Token Information
OAuth Scopes
Consult the Salesforce OAuth 2.0 Documentation to find out what Available OAuth Scopes your app needs.
Salesforce Documentation
Links to Salesforce documentation pages can be found in each section. Alternatively, here is the holy grail of the Saleforce endpoints.
Usage
Limits
Docs Returns a list of daily API limits for the salesforce api. Refer to the docs for the full list of options.
public function limits(): \Psr\Http\Message\ResponseInterface
UserInfo
Docs Get info about the logged-in user.
public function limits(): \Psr\Http\Message\ResponseInterface
Query
Docs Use the Query resource to execute a SOQL query that returns all the results in a single response.
public function query(string $query): \Psr\Http\Message\ResponseInterface
Find
Docs Find resource $id
of $sobject
, optionally specify the fields you want to retrieve in the fields parameter and use the GET method of the resource.
public function find(string $sobject, string $id, array $fields = []): \Psr\Http\Message\ResponseInterface
Describe
Docs Completely describes the individual metadata at all levels for the specified object.
public function describe(string $sobject): \Psr\Http\Message\ResponseInterface
Create
Docs Create new records of $sobject
. The response body will contain the ID of the created record if the call is successful.
public function create(string $sobject, array $data): \Psr\Http\Message\ResponseInterface
Update
Docs You use the SObject Rows resource to update records. The response will be the a bool of $success
.
public function update(string $sobject, string $id, array $data):bool
Contributing
Thanks for considering contributing to our Restforcephp project. Just a few things:
- Make sure your commit conforms to the PSR-2 coding standard.
- Make sure your commit messages are well defined.
- Make sure you have added the necessary unit tests for your changes.
- Run all the tests to assure nothing else was accidentally broken.
- Submit a pull request.
Unit Tests:
With Code Coverage:
Check PHP-CS PSR2 Test:
Apply PHP-CS PSR2 Fix:
Auto runs and resolves some low hanging PSR2 fixes, this might not get all of them, so rerun the check after.