Merge tag '2.0.5'
This commit is contained in:
commit
c9af0afe07
4 changed files with 10 additions and 5 deletions
|
|
@ -3,7 +3,7 @@
|
|||
"type": "library",
|
||||
"description": "LDC CRM Client V2",
|
||||
"license": "MIT",
|
||||
"version": "2.0.4",
|
||||
"version": "2.0.5",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jérémy Munsch",
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -495,7 +495,7 @@ class WPCrm
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
private static function _saveOrUpdateUserToTable()
|
||||
private static function saveOrUpdateUserToTable()
|
||||
{
|
||||
if (self::getUserToTable(self::$user->crm_id)) {
|
||||
self::query(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue