diff --git a/config/services.yaml b/config/services.yaml index 5e1b95c5..42044b7d 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -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" diff --git a/src/Command/CreateCustomerFromWarrantyCommand.php b/src/Command/CreateCustomerFromWarrantyCommand.php index 9d24fc03..91ae38d1 100644 --- a/src/Command/CreateCustomerFromWarrantyCommand.php +++ b/src/Command/CreateCustomerFromWarrantyCommand.php @@ -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(); }