class Partner in Lockr 7.2
Same name and namespace in other branches
- 7 src/Lockr/Partner.php \Lockr\Partner
Hierarchy
- class \Lockr\Partner implements PartnerInterface
Expanded class hierarchy of Partner
1 file declares its use of Partner
- lockr.module in ./
lockr.module - Hook implementations and callbacks for lockr.
File
- vendor/
lockr/ lockr-client/ src/ Partner.php, line 6
Namespace
LockrView source
class Partner implements PartnerInterface {
/**
* @var string The SSL cert path.
*/
protected $cert;
/**
* @var string The Lockr partner.
*/
protected $partner;
/**
* @var string The Lockr region.
*/
protected $region;
/**
* Constucts the partner.
*/
public function __construct($cert, $partner, $region = 'us') {
$this->cert = $cert;
$this->partner = $partner;
$this->region = $region;
}
/**
* {@inheritdoc}
*/
public function requestOptions() {
return array(
'cert' => $this->cert,
);
}
/**
* {@inheritdoc}
*/
public function getReadUri() {
if ($this->region != 'us') {
return "https://{$this->region}.{$this->partner}.api.lockr.io";
}
return "https://{$this->partner}.api.lockr.io";
}
/**
* {@inheritdoc}
*/
public function getWriteUri() {
if ($this->region != 'us') {
return "https://{$this->region}.{$this->partner}.api.lockr.io";
}
return "https://{$this->partner}.api.lockr.io";
}
/**
* {@inheritdoc}
*/
public function getAccountingUri() {
return "https://{$this->partner}.api.lockr.io";
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Partner:: |
protected | property | ||
Partner:: |
protected | property | ||
Partner:: |
protected | property | ||
Partner:: |
public | function | ||
Partner:: |
public | function |
Gets the partner base URI for reading data. Overrides PartnerInterface:: |
|
Partner:: |
public | function |
Gets the partner base URI for writing data. Overrides PartnerInterface:: |
|
Partner:: |
public | function |
Adds required request options to the request for partner authentication. Overrides PartnerInterface:: |
|
Partner:: |
public | function | Constucts the partner. |