Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

32 lines
860B

  1. <?php
  2. namespace Lc\CaracoleBundle\Factory\Credit;
  3. use App\Entity\Credit\CreditHistory;
  4. use Lc\CaracoleBundle\Model\Credit\CreditHistoryInterface;
  5. use Lc\CaracoleBundle\Model\User\UserMerchantInterface;
  6. use Lc\SovBundle\Factory\AbstractFactory;
  7. use Lc\SovBundle\Model\User\UserInterface;
  8. class CreditHistoryFactory extends AbstractFactory
  9. {
  10. // createCreditHistory
  11. public function create(string $type,UserMerchantInterface $userMerchant ): CreditHistoryInterface
  12. {
  13. $creditHistory = $this->createBase($userMerchant);
  14. $creditHistory->setType($type) ;
  15. return $creditHistory;
  16. }
  17. public function createBase(UserMerchantInterface $userMerchant): CreditHistoryInterface
  18. {
  19. $creditHistory = new CreditHistory();
  20. $creditHistory->setUserMerchant($userMerchant) ;
  21. return $creditHistory;
  22. }
  23. }