1. Go to this page and download the library: Download voycey/cakephp-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/ */
namespace App\Controller;
use App\Controller\AppController;
use Cake\Event\Event;
class SalesforcesController extends AppController
{
public function beforeFilter(Event $event)
{
parent::beforeFilter($event);
}
public function index()
{
$this->autoRender = false;
$this->loadModel('Salesforce.SalesforceContact');
$query = $this->SalesforceContact->find('all')
->select(['Id','Email','LastName'])
->where(['Email' => "[email protected]"]
);
foreach ($query as $row) {
echo "<pre>";
print_r($row);
echo "</pre>";
}
}
}
namespace App\Model\Table;
use Salesforce\Model\Entity\Salesforce;
use Salesforce\Model\Table\SalesforcesTable;
class SalesforceAccountTable extends SalesforcesTable
{
public $name = "Account";
/**
* Initialize method
*
* @param array $config The configuration for the Table.
* @return void
*/
public function initialize(array $config)
{
parent::initialize($config);
$this->table('Account');
$this->displayField('Name');
$this->primaryKey('Id');
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.