您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

27 行
629B

  1. <?php
  2. namespace Lc\CaracoleBundle\Solver\User;
  3. use Lc\CaracoleBundle\Model\User\UserMerchantInterface;
  4. class UserMerchantSolver
  5. {
  6. public function isCreditActive(UserMerchantInterface $userMerchant = null)
  7. {
  8. if (!$userMerchant || ($userMerchant && !$userMerchant->isCreditActive())) {
  9. return false;
  10. }
  11. return true;
  12. }
  13. public function isCreditSufficientToPay(UserMerchantInterface $userMerchant, float $amount)
  14. {
  15. if ($this->isCreditActive($userMerchant) && $userMerchant->getCredit() >= $amount) {
  16. return true;
  17. }
  18. return false;
  19. }
  20. }