Remove dotenv implementation from customer creation from warranty. #275

This commit is contained in:
Korina Cordero 2019-11-22 04:01:54 +00:00
parent e462570d9d
commit 0372dc5a5a
2 changed files with 8 additions and 8 deletions

View file

@ -97,6 +97,11 @@ services:
$policy_third_party: "%env(POLICY_THIRD_PARTY)%"
$policy_mobile: "%env(POLICY_MOBILE)%"
App\Command\CreateCustomerFromWarrantyCommand:
arguments:
$cvu_mfg_id: "%env(CVU_MFG_ID)%"
$cvu_brand_id: "%env(CVU_BRAND_ID)%"
Catalyst\APIBundle\Security\APIKeyUserProvider:
arguments:
$em: "@doctrine.orm.entity_manager"

View file

@ -34,17 +34,12 @@ class CreateCustomerFromWarrantyCommand extends Command
protected $cvu_mfg_id;
protected $cvu_brand_id;
public function __construct(ObjectManager $em)
public function __construct(ObjectManager $em, $cvu_mfg_id, $cvu_brand_id)
{
$this->em = $em;
// get the default ids from .env
// TODO: DO NOT USE $_ENV
$dotenv = new Dotenv();
$dotenv->loadEnv(__DIR__.'/../../.env');
$this->cvu_mfg_id = $_ENV['CVU_MFG_ID'];
$this->cvu_brand_id = $_ENV['CVU_BRAND_ID'];
$this->cvu_mfg_id = $cvu_mfg_id;
$this->cvu_brand_id = $cvu_brand_id;
parent::__construct();
}