From 19a65a8ed391c177d41242f55648d17763017cdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20=C3=81lvarez?= Date: Tue, 24 May 2022 10:06:04 +0200 Subject: [PATCH] prop names --- src/Controller/IndexController.php | 10 +++++++++- src/Entity/MerBeDM.php | 6 +++--- src/Entity/MerDM.php | 6 +++--- src/Entity/MerDT.php | 6 +++--- src/Entity/MerParaDM.php | 6 +++--- src/Entity/MerParaDT.php | 6 +++--- src/Entity/MerSubBaseTrait.php | 12 ++++++------ src/Repository/MerBeDMRepository.php | 10 ++++++++++ 8 files changed, 40 insertions(+), 22 deletions(-) diff --git a/src/Controller/IndexController.php b/src/Controller/IndexController.php index 8857ac0..dbf9b91 100644 --- a/src/Controller/IndexController.php +++ b/src/Controller/IndexController.php @@ -2,6 +2,7 @@ namespace App\Controller; +use App\Repository\MerBeDMRepository; use App\Repository\MerBeSubRepository; use App\Repository\MerParaSubRepository; use App\Repository\MerServiceRepository; @@ -40,11 +41,18 @@ class IndexController extends AbstractController } #[Route('/notification/dm', name: 'notification_dm')] - public function notificationDm(Request $request, MerServiceRepository $repo): Response + public function notificationDm( + Request $request, + MerServiceRepository $repo, + MerBeDMRepository $repoDm + ): Response { dump('MerServiceRepository->findByOfferId'); dump($repo->findByOfferId($request->query->get('offer_id'))); + dump('MerBeDMRepository->findByOfferId'); + dump($repoDm->findByOfferId($request->query->get('offer_id'))); + return $this->render('index/notificationDm.html.twig'); } } diff --git a/src/Entity/MerBeDM.php b/src/Entity/MerBeDM.php index 2240e3b..95e7cfa 100644 --- a/src/Entity/MerBeDM.php +++ b/src/Entity/MerBeDM.php @@ -16,7 +16,7 @@ class MerBeDM extends MerService // private $id; #[ORM\Column(type: 'string', length: 255)] - private $activationCode; + private $activation_code; // public function getId(): ?int // { @@ -25,12 +25,12 @@ class MerBeDM extends MerService public function getActivationCode(): ?string { - return $this->activationCode; + return $this->activation_code; } public function setActivationCode(string $activationCode): self { - $this->activationCode = $activationCode; + $this->activation_code = $activationCode; return $this; } diff --git a/src/Entity/MerDM.php b/src/Entity/MerDM.php index b4854b4..2eb8acb 100644 --- a/src/Entity/MerDM.php +++ b/src/Entity/MerDM.php @@ -14,7 +14,7 @@ trait MerDM // private $id; #[ORM\Column(type: 'integer')] - private $offerId; + private $offer_id; // public function getId(): ?int // { @@ -23,12 +23,12 @@ trait MerDM public function getOfferId(): ?int { - return $this->offerId; + return $this->offer_id; } public function setOfferId(int $offerId): self { - $this->offerId = $offerId; + $this->offer_id = $offerId; return $this; } diff --git a/src/Entity/MerDT.php b/src/Entity/MerDT.php index d581761..66cc709 100644 --- a/src/Entity/MerDT.php +++ b/src/Entity/MerDT.php @@ -14,7 +14,7 @@ trait MerDT // private $id; #[ORM\Column(type: 'string', length: 255)] - private $serviceId; + private $service_id; // public function getId(): ?int // { @@ -23,12 +23,12 @@ trait MerDT public function getServiceId(): ?string { - return $this->serviceId; + return $this->service_id; } public function setServiceId(string $serviceId): self { - $this->serviceId = $serviceId; + $this->service_id = $serviceId; return $this; } diff --git a/src/Entity/MerParaDM.php b/src/Entity/MerParaDM.php index 207b9bb..ba24013 100644 --- a/src/Entity/MerParaDM.php +++ b/src/Entity/MerParaDM.php @@ -16,7 +16,7 @@ class MerParaDM extends MerService // private $id; #[ORM\Column(type: 'string', length: 255)] - private $productCode; + private $product_code; // public function getId(): ?int // { @@ -25,12 +25,12 @@ class MerParaDM extends MerService public function getProductCode(): ?string { - return $this->productCode; + return $this->product_code; } public function setProductCode(string $productCode): self { - $this->productCode = $productCode; + $this->product_code = $productCode; return $this; } diff --git a/src/Entity/MerParaDT.php b/src/Entity/MerParaDT.php index d545e6e..51f8476 100644 --- a/src/Entity/MerParaDT.php +++ b/src/Entity/MerParaDT.php @@ -16,7 +16,7 @@ class MerParaDT extends MerService // private $id; #[ORM\Column(type: 'string', length: 255)] - private $apiKey; + private $api_key; // public function getId(): ?int // { @@ -25,12 +25,12 @@ class MerParaDT extends MerService public function getApiKey(): ?string { - return $this->apiKey; + return $this->api_key; } public function setApiKey(string $apiKey): self { - $this->apiKey = $apiKey; + $this->api_key = $apiKey; return $this; } diff --git a/src/Entity/MerSubBaseTrait.php b/src/Entity/MerSubBaseTrait.php index 84a30c8..a103b95 100644 --- a/src/Entity/MerSubBaseTrait.php +++ b/src/Entity/MerSubBaseTrait.php @@ -20,10 +20,10 @@ trait MerSubBaseTrait private MerService $service; #[ORM\Column(type: 'datetime_immutable')] - private $subDate; + private $sub_date; #[ORM\Column(type: 'datetime_immutable', nullable: true)] - private $unsubDate; + private $unsub_date; public function getId(): ?int { @@ -56,24 +56,24 @@ trait MerSubBaseTrait public function getSubDate(): ?\DateTimeImmutable { - return $this->subDate; + return $this->sub_date; } public function setSubDate(\DateTimeImmutable $subDate): self { - $this->subDate = $subDate; + $this->sub_date = $subDate; return $this; } public function getUnsubDate(): ?\DateTimeImmutable { - return $this->unsubDate; + return $this->unsub_date; } public function setUnsubDate(?\DateTimeImmutable $unsubDate): self { - $this->unsubDate = $unsubDate; + $this->unsub_date = $unsubDate; return $this; } diff --git a/src/Repository/MerBeDMRepository.php b/src/Repository/MerBeDMRepository.php index 36eaa3b..c038124 100644 --- a/src/Repository/MerBeDMRepository.php +++ b/src/Repository/MerBeDMRepository.php @@ -62,4 +62,14 @@ class MerBeDMRepository extends ServiceEntityRepository // ->getOneOrNullResult() // ; // } + + public function findByOfferId(int $offerId) + { + return $this->createQueryBuilder('s') + ->andWhere('s.offer_id = :offer_id') + ->setParameter('offer_id', $offerId) + ->getQuery() + ->getResult() + ; + } }