You've already forked symfony-playground
product as OneToOne
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\MerServiceRepository;
|
||||
use Doctrine\DBAL\Platforms\OraclePlatform;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\InheritanceType('SINGLE_TABLE')]
|
||||
@ -26,6 +27,9 @@ abstract class MerService
|
||||
#[ORM\Column(type: 'json', nullable: true)]
|
||||
private $metadata = [];
|
||||
|
||||
#[ORM\OneToOne(targetEntity: Platform::class, cascade: ['persist'], mappedBy: 'ott')]
|
||||
private Platform $platform;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
@ -54,4 +58,16 @@ abstract class MerService
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPlatform(): ?Platform
|
||||
{
|
||||
return $this->platform;
|
||||
}
|
||||
|
||||
public function setPlatform(?Platform $platform): self
|
||||
{
|
||||
$this->platform = $platform;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user