tokens to CrmApiV2 contructor
This commit is contained in:
parent
b157aadecc
commit
85b9220c1f
2 changed files with 8 additions and 3 deletions
|
|
@ -22,9 +22,12 @@ class CrmApiV2
|
|||
*/
|
||||
private static $apiInterface;
|
||||
|
||||
public function __construct()
|
||||
public function __construct(string $bearerToken = null, string $bearerPwd = null)
|
||||
{
|
||||
self::$apiInterface = self::$apiInterface ?: new ApiInterface();
|
||||
self::$apiInterface = self::$apiInterface ?: new ApiInterface(
|
||||
$bearerToken,
|
||||
$bearerPwd
|
||||
);
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,8 +58,10 @@ class ApiInterface
|
|||
*/
|
||||
protected static $apiToken;
|
||||
|
||||
public function __construct()
|
||||
public function __construct(string $bearerToken = null, string $bearerPwd = null)
|
||||
{
|
||||
static::$bearerToken = static::$bearerToken ?: $bearerToken;
|
||||
static::$bearerPwd = static::$bearerPwd ?: $bearerPwd;
|
||||
static::$bearerToken = static::$bearerToken ?: Utils::getConfig('crm.token');
|
||||
static::$bearerPwd = static::$bearerPwd ?: Utils::getConfig('crm.password');
|
||||
static::$endpoint = static::$endpoint ?: Utils::getConfig('crm.endpoint');
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue