選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

33 行
960B

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