bigdropinc/yii2-salesforce

Salesforce integration for Yii2 framework

Installs: 4 239

Dependents: 0

Suggesters: 0

Security: 0

Stars: 6

Watchers: 7

Forks: 1

Open Issues: 0

Type:yii2-extension

0.3 2017-10-24 14:19 UTC

This package is not auto-updated.

Last update: 2024-11-10 03:56:46 UTC


README

This extension allow you to integrate your Yii2 application with SalesForce.com via regular ActiveRecordInterface.

Installation

Run

composer require --prefer-dist bigdropinc/yii2-salesforce

How to use

  • Define salesforce component:
<?php
return [
    'components' => [
        'salesforce' => [
            'class'          => '\sokyrko\yii\salesforce\components\SalesforceComponent',
            'consumerKey'    => 'applicationConsumerKey',
            'consumerSecret' => 'applicationConsumerSecret',
            'username'       => 'salesForceLogin',
            'password'       => 'salesForcePassword' . 'salesForceAccountSecretKey',
            'loginUrl'       => 'salesForceLoginUrl', // eg: https://login.salesforce.com/
        ],
    ],
];
  • Define salesforce entity with public fields:
<?php

namespace console\models\salesforce;

use sokyrko\yii\salesforce\data\ActiveRecord;

class Account extends ActiveRecord
{
    protected static $isCustom = false; // set false if is not custom model
    
    /** @var string */
    public $Id;
    
    /** @var string */
    public $Name;
}
  • Use same as Yii2 ActiveRecord:
<?php

$account = console\models\salesforce\Account::findOne(['Name' => 'My name']);

var_dump($account); // {Id: 'some-salesforce-id', Name: 'My name'}

You can see more examples for query builder in tests.

TBD

  • Create, update, delete records
  • Complete ActiveRecord tests