PHP code example of php-arsenal / salesforce-mapper-bundle
1. Go to this page and download the library: Download php-arsenal/salesforce-mapper-bundle 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/ */
php-arsenal / salesforce-mapper-bundle example snippets
use PhpArsenal\SalesforceMapperBundle\Mapper;
use PhpArsenal\SalesforceMapperBundle\Model\Opportunity;
class MyService {
private $mapper;
public function __construct(Mapper $mapper) {
$fetchedObjects = $mapper->findBy(new Opportunity(), [
'Name' => 'Just an opportunity',
]);
}
}
...
$opportunity = $fetchedObjects[0];
echo 'The opportunity belongs to: ' . $opportunity->getAccount()->getName();
...