You've already forked symfony-playground
simulation model
This commit is contained in:
@ -4,7 +4,7 @@ namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity]
|
||||
////#[ORM\Entity]
|
||||
class Employee1 extends Person1
|
||||
{
|
||||
#[ORM\Id]
|
||||
|
@ -4,7 +4,7 @@ namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity]
|
||||
////#[ORM\Entity]
|
||||
class Employee2 extends Person2
|
||||
{
|
||||
#[ORM\Id]
|
||||
|
@ -4,7 +4,7 @@ namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity]
|
||||
////#[ORM\Entity]
|
||||
class Employee3 extends Person3
|
||||
{
|
||||
#[ORM\Id]
|
||||
|
37
src/Entity/MerBeDM.php
Normal file
37
src/Entity/MerBeDM.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\MerBeDMRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: MerBeDMRepository::class)]
|
||||
class MerBeDM extends MerService
|
||||
{
|
||||
use MerDM;
|
||||
|
||||
// #[ORM\Id]
|
||||
// #[ORM\GeneratedValue]
|
||||
// #[ORM\Column(type: 'integer')]
|
||||
// private $id;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $activationCode;
|
||||
|
||||
// public function getId(): ?int
|
||||
// {
|
||||
// return $this->id;
|
||||
// }
|
||||
|
||||
public function getActivationCode(): ?string
|
||||
{
|
||||
return $this->activationCode;
|
||||
}
|
||||
|
||||
public function setActivationCode(string $activationCode): self
|
||||
{
|
||||
$this->activationCode = $activationCode;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
35
src/Entity/MerDM.php
Normal file
35
src/Entity/MerDM.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\MerDMRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
//#[ORM\Entity(repositoryClass: MerDMRepository::class)]
|
||||
trait MerDM
|
||||
{
|
||||
// #[ORM\Id]
|
||||
// #[ORM\GeneratedValue]
|
||||
// #[ORM\Column(type: 'integer')]
|
||||
// private $id;
|
||||
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private $offerId;
|
||||
|
||||
// public function getId(): ?int
|
||||
// {
|
||||
// return $this->id;
|
||||
// }
|
||||
|
||||
public function getOfferId(): ?int
|
||||
{
|
||||
return $this->offerId;
|
||||
}
|
||||
|
||||
public function setOfferId(int $offerId): self
|
||||
{
|
||||
$this->offerId = $offerId;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
35
src/Entity/MerDT.php
Normal file
35
src/Entity/MerDT.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\MerDTRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
//#[ORM\Entity(repositoryClass: MerDTRepository::class)]
|
||||
trait MerDT
|
||||
{
|
||||
// #[ORM\Id]
|
||||
// #[ORM\GeneratedValue]
|
||||
// #[ORM\Column(type: 'integer')]
|
||||
// private $id;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $serviceId;
|
||||
|
||||
// public function getId(): ?int
|
||||
// {
|
||||
// return $this->id;
|
||||
// }
|
||||
|
||||
public function getServiceId(): ?string
|
||||
{
|
||||
return $this->serviceId;
|
||||
}
|
||||
|
||||
public function setServiceId(string $serviceId): self
|
||||
{
|
||||
$this->serviceId = $serviceId;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
37
src/Entity/MerParaDM.php
Normal file
37
src/Entity/MerParaDM.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\MerParaDMRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: MerParaDMRepository::class)]
|
||||
class MerParaDM extends MerService
|
||||
{
|
||||
use MerDM;
|
||||
|
||||
// #[ORM\Id]
|
||||
// #[ORM\GeneratedValue]
|
||||
// #[ORM\Column(type: 'integer')]
|
||||
// private $id;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $productCode;
|
||||
|
||||
// public function getId(): ?int
|
||||
// {
|
||||
// return $this->id;
|
||||
// }
|
||||
|
||||
public function getProductCode(): ?string
|
||||
{
|
||||
return $this->productCode;
|
||||
}
|
||||
|
||||
public function setProductCode(string $productCode): self
|
||||
{
|
||||
$this->productCode = $productCode;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
37
src/Entity/MerParaDT.php
Normal file
37
src/Entity/MerParaDT.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\MerParaDTRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: MerParaDTRepository::class)]
|
||||
class MerParaDT extends MerService
|
||||
{
|
||||
use MerDT;
|
||||
|
||||
// #[ORM\Id]
|
||||
// #[ORM\GeneratedValue]
|
||||
// #[ORM\Column(type: 'integer')]
|
||||
// private $id;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private $apiKey;
|
||||
|
||||
// public function getId(): ?int
|
||||
// {
|
||||
// return $this->id;
|
||||
// }
|
||||
|
||||
public function getApiKey(): ?string
|
||||
{
|
||||
return $this->apiKey;
|
||||
}
|
||||
|
||||
public function setApiKey(string $apiKey): self
|
||||
{
|
||||
$this->apiKey = $apiKey;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
51
src/Entity/MerParaSub.php
Normal file
51
src/Entity/MerParaSub.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\MerParaSubRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: MerParaSubRepository::class)]
|
||||
class MerParaSub
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private $id;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
||||
private $redCode;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: MerService::class)]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private MerService $service;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getRedCode(): ?string
|
||||
{
|
||||
return $this->redCode;
|
||||
}
|
||||
|
||||
public function setRedCode(?string $redCode): self
|
||||
{
|
||||
$this->redCode = $redCode;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getService(): ?MerService
|
||||
{
|
||||
return $this->service;
|
||||
}
|
||||
|
||||
public function setService(?MerService $service): self
|
||||
{
|
||||
$this->service = $service;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
57
src/Entity/MerService.php
Normal file
57
src/Entity/MerService.php
Normal file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\MerServiceRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\InheritanceType('SINGLE_TABLE')]
|
||||
#[ORM\DiscriminatorColumn(name: 'discr', type: 'string')]
|
||||
#[ORM\DiscriminatorMap([
|
||||
'para_dm' => MerParaDM::class,
|
||||
'para_dt' => MerParaDT::class,
|
||||
'be_dm' => MerBeDM::class
|
||||
])]
|
||||
#[ORM\Entity(repositoryClass: MerServiceRepository::class)]
|
||||
abstract class MerService
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private $id;
|
||||
|
||||
#[ORM\Column(type: 'integer', nullable: true)]
|
||||
private $mcc_mnc;
|
||||
|
||||
#[ORM\Column(type: 'json', nullable: true)]
|
||||
private $metadata = [];
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getMccMnc(): ?int
|
||||
{
|
||||
return $this->mcc_mnc;
|
||||
}
|
||||
|
||||
public function setMccMnc(?int $mcc_mnc): self
|
||||
{
|
||||
$this->mcc_mnc = $mcc_mnc;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getMetadata(): ?array
|
||||
{
|
||||
return $this->metadata;
|
||||
}
|
||||
|
||||
public function setMetadata(?array $metadata): self
|
||||
{
|
||||
$this->metadata = $metadata;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@ namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\MappedSuperclass]
|
||||
////#[ORM\MappedSuperclass]
|
||||
class Person1
|
||||
{
|
||||
#[ORM\Column(type: 'integer')]
|
||||
|
@ -4,7 +4,7 @@ namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity]
|
||||
////#[ORM\Entity]
|
||||
#[ORM\InheritanceType('SINGLE_TABLE')]
|
||||
#[ORM\DiscriminatorColumn(name: 'discr', type: 'string')]
|
||||
#[ORM\DiscriminatorMap(['person2' => 'Person2', 'employee2' => 'Employee2'])]
|
||||
|
@ -4,7 +4,7 @@ namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity]
|
||||
////#[ORM\Entity]
|
||||
#[ORM\InheritanceType('JOINED')]
|
||||
#[ORM\DiscriminatorColumn(name: 'discr', type: 'string')]
|
||||
#[ORM\DiscriminatorMap(['person3' => 'Person3', 'employee3' => 'Employee3'])]
|
||||
|
@ -4,7 +4,7 @@ namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity]
|
||||
////#[ORM\Entity]
|
||||
class Toothbrush1
|
||||
{
|
||||
#[ORM\Id]
|
||||
|
@ -4,7 +4,7 @@ namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity]
|
||||
////#[ORM\Entity]
|
||||
class Toothbrush2
|
||||
{
|
||||
#[ORM\Id]
|
||||
|
@ -4,7 +4,7 @@ namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity]
|
||||
////#[ORM\Entity]
|
||||
class Toothbrush3
|
||||
{
|
||||
#[ORM\Id]
|
||||
|
Reference in New Issue
Block a user