You are here

class SalesforceCredentials in Salesforce Suite 8.3

Same name and namespace in other branches
  1. 8.4 src/Consumer/SalesforceCredentials.php \Drupal\salesforce\Consumer\SalesforceCredentials
  2. 5.0.x src/Consumer/SalesforceCredentials.php \Drupal\salesforce\Consumer\SalesforceCredentials

Salesforce credentials extension, for drupalisms.

Hierarchy

Expanded class hierarchy of SalesforceCredentials

File

src/Consumer/SalesforceCredentials.php, line 10

Namespace

Drupal\salesforce\Consumer
View source
class SalesforceCredentials extends Credentials implements SalesforceCredentialsInterface {

  /**
   * Login URL e.g. https://test.salesforce.com or https://login.salesforce.com.
   *
   * @var string
   */
  protected $loginUrl;

  /**
   * Consumer key for the Salesforce connected OAuth app.
   *
   * @var string
   */
  protected $consumerKey;

  /**
   * {@inheritdoc}
   */
  public function getConsumerKey() {
    return $this->consumerKey;
  }

  /**
   * {@inheritdoc}
   */
  public function getLoginUrl() {
    return $this->loginUrl;
  }

  /**
   * {@inheritdoc}
   */
  public function getCallbackUrl() {
    return Url::fromRoute('salesforce.oauth_callback', [], [
      'absolute' => TRUE,
      'https' => TRUE,
    ])
      ->toString();
  }
  public function isValid() {

    // This class is a stub.
    return FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(array $configuration) {
    return new static($configuration['consumer_key'], $configuration['consumer_secret'], NULL);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SalesforceCredentials::$consumerKey protected property Consumer key for the Salesforce connected OAuth app.
SalesforceCredentials::$loginUrl protected property Login URL e.g. https://test.salesforce.com or https://login.salesforce.com.
SalesforceCredentials::create public static function 1
SalesforceCredentials::getCallbackUrl public function 1
SalesforceCredentials::getConsumerKey public function Get the consumer key for these credentials. Overrides SalesforceCredentialsInterface::getConsumerKey
SalesforceCredentials::getLoginUrl public function Get the login URL for these credentials. Overrides SalesforceCredentialsInterface::getLoginUrl
SalesforceCredentials::isValid public function 1