|
|
|
|
|
|
|
|
return $userMerchant ; |
|
|
return $userMerchant ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function updateCreditActive($user, $merchant = null, $creditActive = true) |
|
|
|
|
|
|
|
|
public function updateCreditActive($user = null, $merchant = null, $creditActive = true) |
|
|
{ |
|
|
{ |
|
|
|
|
|
if(!$user) { |
|
|
|
|
|
$user = $this->security->getUser() ; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
$userMerchant = $this->getUserMerchant($user, $merchant) ; |
|
|
$userMerchant = $this->getUserMerchant($user, $merchant) ; |
|
|
if(!$userMerchant) { |
|
|
if(!$userMerchant) { |
|
|
$userMerchant = $this->createUserMerchant($user, $merchant) ; |
|
|
$userMerchant = $this->createUserMerchant($user, $merchant) ; |
|
|
|
|
|
|
|
|
return $userMerchant ; |
|
|
return $userMerchant ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function activeCredit($user, $merchant = null) |
|
|
|
|
|
|
|
|
public function activeCredit($user = null, $merchant = null) |
|
|
{ |
|
|
{ |
|
|
return $this->updateCreditActive($user, $merchant, true) ; |
|
|
return $this->updateCreditActive($user, $merchant, true) ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function unactiveCredit($user, $merchant = null) |
|
|
|
|
|
|
|
|
public function unactiveCredit($user = null, $merchant = null) |
|
|
{ |
|
|
{ |
|
|
return $this->updateCreditActive($user, $merchant, false) ; |
|
|
return $this->updateCreditActive($user, $merchant, false) ; |
|
|
} |
|
|
} |