Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

28 rindas
857B

  1. <?php
  2. namespace Lc\CaracoleBundle\Factory\Reduction;
  3. use App\Entity\Reduction\ReductionCredit;
  4. use Lc\CaracoleBundle\Container\Reduction\ReductionCreditContainer;
  5. use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
  6. use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface;
  7. use Lc\CaracoleBundle\Model\Reduction\ReductionCreditModel;
  8. use Lc\SovBundle\Factory\AbstractFactory;
  9. class ReductionCreditFactory extends AbstractFactory
  10. {
  11. public function create(MerchantInterface $merchant, string $type = ReductionCreditModel::TYPE_CREDIT): ReductionCreditInterface
  12. {
  13. $class = ReductionCreditContainer::getEntityFqcn();
  14. $reductionCredit = new $class;
  15. $reductionCredit->setMerchant($merchant);
  16. $reductionCredit->setType($type);
  17. $reductionCredit->setStatus(1);
  18. return $reductionCredit;
  19. }
  20. }