Remove dotenv implementation from setting of customer privacy policy. #275
This commit is contained in:
parent
3babcd765f
commit
e462570d9d
3 changed files with 20 additions and 14 deletions
|
|
@ -91,6 +91,12 @@ services:
|
||||||
arguments:
|
arguments:
|
||||||
$geofence_flag: "%env(GEOFENCE_ENABLE)%"
|
$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)%"
|
||||||
|
|
||||||
Catalyst\APIBundle\Security\APIKeyUserProvider:
|
Catalyst\APIBundle\Security\APIKeyUserProvider:
|
||||||
arguments:
|
arguments:
|
||||||
$em: "@doctrine.orm.entity_manager"
|
$em: "@doctrine.orm.entity_manager"
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class ImportPartnersCommand extends Command
|
||||||
|
|
||||||
protected $em;
|
protected $em;
|
||||||
|
|
||||||
public function __construct(Objectmanager $om)
|
public function __construct(ObjectManager $om)
|
||||||
{
|
{
|
||||||
$this->em = $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\InputOption;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
use Symfony\Component\Dotenv\Dotenv;
|
|
||||||
|
|
||||||
use Doctrine\Common\Persistence\ObjectManager;
|
use Doctrine\Common\Persistence\ObjectManager;
|
||||||
|
|
||||||
|
|
@ -19,10 +18,19 @@ class SetCustomerPrivacyPolicyCommand extends Command
|
||||||
{
|
{
|
||||||
private $em;
|
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->em = $om;
|
||||||
|
|
||||||
|
$this->policy_promo_id = $policy_promo;
|
||||||
|
$this->policy_third_party_id = $policy_third_party;
|
||||||
|
$this->policy_mobile_id = $policy_mobile;
|
||||||
|
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -35,16 +43,8 @@ class SetCustomerPrivacyPolicyCommand extends Command
|
||||||
|
|
||||||
protected function execute(InputInterface $input, OutputInterface $output)
|
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
|
// 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
|
// get customers on third party
|
||||||
$third_party_customers = $this->em->getRepository(Customer::class)->findBy(['priv_third_party' => true]);
|
$third_party_customers = $this->em->getRepository(Customer::class)->findBy(['priv_third_party' => true]);
|
||||||
|
|
@ -54,7 +54,7 @@ class SetCustomerPrivacyPolicyCommand extends Command
|
||||||
}
|
}
|
||||||
|
|
||||||
// get promo policy
|
// 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
|
// get customers on promo
|
||||||
$promo_customers = $this->em->getRepository(Customer::class)->findBy(['priv_promo' => true]);
|
$promo_customers = $this->em->getRepository(Customer::class)->findBy(['priv_promo' => true]);
|
||||||
|
|
@ -66,7 +66,7 @@ class SetCustomerPrivacyPolicyCommand extends Command
|
||||||
$this->em->flush();
|
$this->em->flush();
|
||||||
|
|
||||||
// get mobile policy
|
// 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
|
// get mobile sessions
|
||||||
$mobile_sessions = $this->em->getRepository(MobileSession::class)->findAll();
|
$mobile_sessions = $this->em->getRepository(MobileSession::class)->findAll();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue