Start on recipes

This commit is contained in:
Tim 2021-12-31 00:18:30 +01:00
parent 08c250a78b
commit f2a85c6c7d
2 changed files with 63 additions and 0 deletions

View File

@ -0,0 +1,52 @@
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\InheritanceType('SINGLE_TABLE')]
//#[ORM\DiscriminatorColumn(name: 'discriminator', type: 'string')]
//#[ORM\DiscriminatorMap(['recipe' => 'RecipeProductLine'])]
abstract class AbstractProductLine
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'integer')]
private $count;
#[ORM\ManyToOne(targetEntity: Product::class)]
private $product;
public function getId(): ?int
{
return $this->id;
}
public function getCount(): ?int
{
return $this->count;
}
public function setCount($count): self
{
$this->count = $count;
return $this;
}
public function getProduct(): ?Product
{
return $this->product;
}
public function setProduct($product): self
{
$this->product = $product;
return $this;
}
}

View File

@ -0,0 +1,11 @@
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
class RecipeProductLine extends AbstractProductLine
{
}