Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

UserMerchantFactory.php 875B

il y a 3 ans
il y a 3 ans
il y a 3 ans
123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace Lc\CaracoleBundle\Factory\User;
  3. use App\Entity\User\UserMerchant;
  4. use Lc\CaracoleBundle\Context\MerchantContextTrait;
  5. use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
  6. use Lc\CaracoleBundle\Model\User\UserMerchantInterface;
  7. use Lc\SovBundle\Factory\AbstractFactory;
  8. use Lc\SovBundle\Model\User\UserInterface;
  9. class UserMerchantFactory extends AbstractFactory
  10. {
  11. public function createBase(MerchantInterface $merchant): UserMerchantInterface
  12. {
  13. $userMerchant = new UserMerchant();
  14. $userMerchant->setMerchant($merchant);
  15. return $userMerchant;
  16. }
  17. // createUserMerchant
  18. public function create(MerchantInterface $merchant, UserInterface $user = null): UserMerchantInterface
  19. {
  20. $userMerchant = $this->createBase($merchant);
  21. $userMerchant->setUser($user);
  22. return $userMerchant;
  23. }
  24. }