PHP code example of doitcloudconsulting / salesforce

1. Go to this page and download the library: Download doitcloudconsulting/salesforce library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

doitcloudconsulting / salesforce example snippets


$ php artisan vendor:publish --tag=config

####### Result #######

Copied File [/myProject/DoITCloudConsulting/Salesforce/src/config/SalesforceConfig.php] To [/config/SalesforceConfig.php]


$ php artisan vendor:publish --tag=wsdlconfig


$salesforce = new Salesforce();
$salesforce->insert(array('Name' => 'DoIT Acc FROM ToolKit'), 'Account');


$salesforce = new Salesforce();
$salesforce->update(array('Name' => 'DoIT Acc ', 'id' => '001f400000yNY0LAAW'), 'Account');

$salesforce = new Salesforce();
$salesforce->upsert(array(
	array('Name' => 'Acc1'),
	array('Name' => 'Acc2'),
	array('Name' => 'Acc2', 'Phone' => 192837465, 'id' => '001f400000yNY0LAAW'),
	), 'Account');

$salesforce = new Salesforce();

$lead = $salesforce->insert(
        array('lastname' => 'Homerito Hernández', 
              'Email' => '[email protected]', 
              'Phone' => 1234588892, 
              'Company' => 'DoIT Cloud Consulting'
          ), 'Lead');

$salesforce->convertLead($lead->id, 'Closed - Converted');