You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- <?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
- }
- }
|