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.
|
- <?php
-
- namespace Lc\CaracoleBundle\Factory\User;
-
- use Doctrine\ORM\EntityManagerInterface;
- use Lc\CaracoleBundle\Model\User\UserMerchantInterface;
- use Lc\CaracoleBundle\Resolver\MerchantResolver;
- use Lc\SovBundle\Factory\AbstractFactory;
-
- class UserMerchantFactory extends AbstractFactory
- {
- protected $merchantResolver;
-
- public function __construct(EntityManagerInterface $em, MerchantResolver $merchantResolver)
- {
- parent::__construct($em);
- $this->merchantResolver = $merchantResolver;
- }
-
- public function getEntityClass()
- {
- return UserMerchantInterface::class;
- }
-
- public function create($params = array())
- {
- if(!isset($params['merchant'])){
- $params['merchant'] = $this->merchantResolver->getCurrent();
- }
-
- if(!isset($params['creditActive'])){
- $params['creditActive'] =false;
- }
-
- if(!isset($params['active'])){
- $params['active'] = true;
- }
-
- return parent::create($params); // TODO: Change the autogenerated stub
- }
- }
|