Merge branch '275-remove-env-implementation' into 'master'
Resolve "Remove ENV implementation" Closes #275 See merge request jankstudio/resq!323
This commit is contained in:
commit
4621fa5ec4
4 changed files with 28 additions and 22 deletions
|
|
@ -91,6 +91,17 @@ services:
|
|||
arguments:
|
||||
$geofence_flag: "%env(GEOFENCE_ENABLE)%"
|
||||
|
||||
App\Command\SetCustomerPrivacyPolicyCommand:
|
||||
arguments:
|
||||
$policy_promo: "%env(POLICY_PROMO)%"
|
||||
$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"
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class ImportPartnersCommand extends Command
|
|||
|
||||
protected $em;
|
||||
|
||||
public function __construct(Objectmanager $om)
|
||||
public function __construct(ObjectManager $om)
|
||||
{
|
||||
$this->em = $om;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ use Symfony\Component\Console\Input\InputArgument;
|
|||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Dotenv\Dotenv;
|
||||
|
||||
use Doctrine\Common\Persistence\ObjectManager;
|
||||
|
||||
|
|
@ -19,10 +18,19 @@ class SetCustomerPrivacyPolicyCommand extends Command
|
|||
{
|
||||
private $em;
|
||||
|
||||
public function __construct(ObjectManager $om)
|
||||
private $policy_promo_id;
|
||||
private $policy_third_party_id;
|
||||
private $policy_mobile_id;
|
||||
|
||||
public function __construct(ObjectManager $om, $policy_promo,
|
||||
$policy_third_party, $policy_mobile)
|
||||
{
|
||||
$this->em = $om;
|
||||
|
||||
$this->policy_promo_id = $policy_promo;
|
||||
$this->policy_third_party_id = $policy_third_party;
|
||||
$this->policy_mobile_id = $policy_mobile;
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
|
@ -35,16 +43,8 @@ class SetCustomerPrivacyPolicyCommand extends Command
|
|||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
// get the policy ids from .env
|
||||
$dotenv = new Dotenv();
|
||||
$dotenv->loadEnv(__DIR__.'/../../.env');
|
||||
|
||||
$policy_promo_id = $_ENV['POLICY_PROMO'];
|
||||
$policy_third_party_id = $_ENV['POLICY_THIRD_PARTY'];
|
||||
$policy_mobile_id = $_ENV['POLICY_MOBILE'];
|
||||
|
||||
// get third party policy
|
||||
$third_party_policy = $this->em->getRepository(PrivacyPolicy::class)->find($policy_third_party_id);
|
||||
$third_party_policy = $this->em->getRepository(PrivacyPolicy::class)->find($this->policy_third_party_id);
|
||||
|
||||
// get customers on third party
|
||||
$third_party_customers = $this->em->getRepository(Customer::class)->findBy(['priv_third_party' => true]);
|
||||
|
|
@ -54,7 +54,7 @@ class SetCustomerPrivacyPolicyCommand extends Command
|
|||
}
|
||||
|
||||
// get promo policy
|
||||
$promo_policy = $this->em->getRepository(PrivacyPolicy::class)->find($policy_promo_id);
|
||||
$promo_policy = $this->em->getRepository(PrivacyPolicy::class)->find($this->policy_promo_id);
|
||||
|
||||
// get customers on promo
|
||||
$promo_customers = $this->em->getRepository(Customer::class)->findBy(['priv_promo' => true]);
|
||||
|
|
@ -66,7 +66,7 @@ class SetCustomerPrivacyPolicyCommand extends Command
|
|||
$this->em->flush();
|
||||
|
||||
// get mobile policy
|
||||
$mobile_policy = $this->em->getRepository(PrivacyPolicy::class)->find($policy_mobile_id);
|
||||
$mobile_policy = $this->em->getRepository(PrivacyPolicy::class)->find($this->policy_mobile_id);
|
||||
|
||||
// get mobile sessions
|
||||
$mobile_sessions = $this->em->getRepository(MobileSession::class)->findAll();
|
||||
|
|
|
|||
Loading…
Reference in a new issue