prop names

This commit is contained in:
Sergio Álvarez 2022-05-24 10:06:04 +02:00
parent b1d6490d24
commit 19a65a8ed3
No known key found for this signature in database
GPG Key ID: 622780889DFDBDA5
8 changed files with 40 additions and 22 deletions

View File

@ -2,6 +2,7 @@
namespace App\Controller; namespace App\Controller;
use App\Repository\MerBeDMRepository;
use App\Repository\MerBeSubRepository; use App\Repository\MerBeSubRepository;
use App\Repository\MerParaSubRepository; use App\Repository\MerParaSubRepository;
use App\Repository\MerServiceRepository; use App\Repository\MerServiceRepository;
@ -40,11 +41,18 @@ class IndexController extends AbstractController
} }
#[Route('/notification/dm', name: 'notification_dm')] #[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('MerServiceRepository->findByOfferId');
dump($repo->findByOfferId($request->query->get('offer_id'))); 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'); return $this->render('index/notificationDm.html.twig');
} }
} }

View File

@ -16,7 +16,7 @@ class MerBeDM extends MerService
// private $id; // private $id;
#[ORM\Column(type: 'string', length: 255)] #[ORM\Column(type: 'string', length: 255)]
private $activationCode; private $activation_code;
// public function getId(): ?int // public function getId(): ?int
// { // {
@ -25,12 +25,12 @@ class MerBeDM extends MerService
public function getActivationCode(): ?string public function getActivationCode(): ?string
{ {
return $this->activationCode; return $this->activation_code;
} }
public function setActivationCode(string $activationCode): self public function setActivationCode(string $activationCode): self
{ {
$this->activationCode = $activationCode; $this->activation_code = $activationCode;
return $this; return $this;
} }

View File

@ -14,7 +14,7 @@ trait MerDM
// private $id; // private $id;
#[ORM\Column(type: 'integer')] #[ORM\Column(type: 'integer')]
private $offerId; private $offer_id;
// public function getId(): ?int // public function getId(): ?int
// { // {
@ -23,12 +23,12 @@ trait MerDM
public function getOfferId(): ?int public function getOfferId(): ?int
{ {
return $this->offerId; return $this->offer_id;
} }
public function setOfferId(int $offerId): self public function setOfferId(int $offerId): self
{ {
$this->offerId = $offerId; $this->offer_id = $offerId;
return $this; return $this;
} }

View File

@ -14,7 +14,7 @@ trait MerDT
// private $id; // private $id;
#[ORM\Column(type: 'string', length: 255)] #[ORM\Column(type: 'string', length: 255)]
private $serviceId; private $service_id;
// public function getId(): ?int // public function getId(): ?int
// { // {
@ -23,12 +23,12 @@ trait MerDT
public function getServiceId(): ?string public function getServiceId(): ?string
{ {
return $this->serviceId; return $this->service_id;
} }
public function setServiceId(string $serviceId): self public function setServiceId(string $serviceId): self
{ {
$this->serviceId = $serviceId; $this->service_id = $serviceId;
return $this; return $this;
} }

View File

@ -16,7 +16,7 @@ class MerParaDM extends MerService
// private $id; // private $id;
#[ORM\Column(type: 'string', length: 255)] #[ORM\Column(type: 'string', length: 255)]
private $productCode; private $product_code;
// public function getId(): ?int // public function getId(): ?int
// { // {
@ -25,12 +25,12 @@ class MerParaDM extends MerService
public function getProductCode(): ?string public function getProductCode(): ?string
{ {
return $this->productCode; return $this->product_code;
} }
public function setProductCode(string $productCode): self public function setProductCode(string $productCode): self
{ {
$this->productCode = $productCode; $this->product_code = $productCode;
return $this; return $this;
} }

View File

@ -16,7 +16,7 @@ class MerParaDT extends MerService
// private $id; // private $id;
#[ORM\Column(type: 'string', length: 255)] #[ORM\Column(type: 'string', length: 255)]
private $apiKey; private $api_key;
// public function getId(): ?int // public function getId(): ?int
// { // {
@ -25,12 +25,12 @@ class MerParaDT extends MerService
public function getApiKey(): ?string public function getApiKey(): ?string
{ {
return $this->apiKey; return $this->api_key;
} }
public function setApiKey(string $apiKey): self public function setApiKey(string $apiKey): self
{ {
$this->apiKey = $apiKey; $this->api_key = $apiKey;
return $this; return $this;
} }

View File

@ -20,10 +20,10 @@ trait MerSubBaseTrait
private MerService $service; private MerService $service;
#[ORM\Column(type: 'datetime_immutable')] #[ORM\Column(type: 'datetime_immutable')]
private $subDate; private $sub_date;
#[ORM\Column(type: 'datetime_immutable', nullable: true)] #[ORM\Column(type: 'datetime_immutable', nullable: true)]
private $unsubDate; private $unsub_date;
public function getId(): ?int public function getId(): ?int
{ {
@ -56,24 +56,24 @@ trait MerSubBaseTrait
public function getSubDate(): ?\DateTimeImmutable public function getSubDate(): ?\DateTimeImmutable
{ {
return $this->subDate; return $this->sub_date;
} }
public function setSubDate(\DateTimeImmutable $subDate): self public function setSubDate(\DateTimeImmutable $subDate): self
{ {
$this->subDate = $subDate; $this->sub_date = $subDate;
return $this; return $this;
} }
public function getUnsubDate(): ?\DateTimeImmutable public function getUnsubDate(): ?\DateTimeImmutable
{ {
return $this->unsubDate; return $this->unsub_date;
} }
public function setUnsubDate(?\DateTimeImmutable $unsubDate): self public function setUnsubDate(?\DateTimeImmutable $unsubDate): self
{ {
$this->unsubDate = $unsubDate; $this->unsub_date = $unsubDate;
return $this; return $this;
} }

View File

@ -62,4 +62,14 @@ class MerBeDMRepository extends ServiceEntityRepository
// ->getOneOrNullResult() // ->getOneOrNullResult()
// ; // ;
// } // }
public function findByOfferId(int $offerId)
{
return $this->createQueryBuilder('s')
->andWhere('s.offer_id = :offer_id')
->setParameter('offer_id', $offerId)
->getQuery()
->getResult()
;
}
} }