This commit is contained in:
Sergio Álvarez 2022-05-23 17:21:21 +02:00
parent 7f97b7c5a9
commit 84caa3a6ca
No known key found for this signature in database
GPG Key ID: 622780889DFDBDA5
2 changed files with 27 additions and 18 deletions

View File

@ -13,10 +13,31 @@ class MerFixtures extends Fixture
{
public function load(ObjectManager $manager): void
{
// service1
$tmp = new MerParaDM();
$tmp->setMccMnc(12345)->setOfferId(221)->setProductCode('code1');
$manager->persist($tmp);
// sub
$sub = new MerParaSub();
$sub->setService($tmp)->setPin(1122)->setSubDate(new \DateTimeImmutable('now'));
$manager->persist($sub);
// service 2
$tmp = new MerParaDM();
$tmp->setMccMnc(12345)->setOfferId(223)->setProductCode('code2');
$manager->persist($tmp);
// sub
$sub = new MerParaSub();
$sub->setService($tmp)->setPin(2211)->setSubDate(new \DateTimeImmutable('now'));
$manager->persist($sub);
$sub = new MerParaSub();
$sub->setService($tmp)->setSubDate(new \DateTimeImmutable('now'));
$manager->persist($sub);
// service 3
$tmp = new MerParaDT();
$tmp->setMccMnc(12345)->setServiceId('ser-vi-ce1')->setApiKey('api1');
$manager->persist($tmp);
@ -29,18 +50,6 @@ class MerFixtures extends Fixture
$tmp->setMccMnc(12341)->setOfferId(112)->setActivationCode('active1');
$manager->persist($tmp);
$tmp = new MerParaDM();
$tmp->setMccMnc(12345)->setOfferId(221)->setProductCode('code1');
$manager->persist($tmp);
$sub = new MerParaSub();
$sub->setService($tmp)->setRedCode('redcode1')->setSubDate(new \DateTimeImmutable('now'));
$manager->persist($sub);
$sub = new MerParaSub();
$sub->setService($tmp)->setRedCode('redcode2')->setSubDate(new \DateTimeImmutable('now'));
$manager->persist($sub);
$manager->flush();
}
}

View File

@ -13,8 +13,8 @@ class MerParaSub
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $redCode;
#[ORM\Column(type: 'integer', nullable: true)]
private $pin;
#[ORM\ManyToOne(targetEntity: MerService::class)]
#[ORM\JoinColumn(nullable: false)]
@ -31,14 +31,14 @@ class MerParaSub
return $this->id;
}
public function getRedCode(): ?string
public function getPin(): ?int
{
return $this->redCode;
return $this->pin;
}
public function setRedCode(?string $redCode): self
public function setPin(?int $pin): self
{
$this->redCode = $redCode;
$this->pin = $pin;
return $this;
}