Nie możesz wybrać więcej, niż 25 tematów
Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
|
- <?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
- }
- }
|