<?php
namespace Roothirsch\DeliveryTimeEstimatorBundle\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use Roothirsch\DeliveryTimeEstimatorBundle\Repository\ProductRepository;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ApiResource(shortName="DeliveryTimeEstimator/Product")
* @ORM\Entity
* @ORM\Table(name="delivery_time_estimator_product")
*/
class Product
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Groups({"read"})
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
* @Groups({"read"})
* @Gedmo\Translatable
*/
private $title;
/**
* @ORM\Column(type="integer")
* @Groups({"read"})
*/
private $manufacturingDays;
/**
* @ORM\Column(type="boolean")
* @Groups({"read"})
*/
private $onRequestOnly;
/**
* @Gedmo\SortablePosition
* @ORM\Column(name="position", type="integer")
* @Groups({"read"})
*/
private $position = 9999;
/**
* @Gedmo\SortableGroup
* @ORM\ManyToOne(targetEntity=ProductGroup::class, inversedBy="products")
*/
private $productGroup;
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getManufacturingDays(): ?int
{
return $this->manufacturingDays;
}
public function setManufacturingDays(int $manufacturingDays): self
{
$this->manufacturingDays = $manufacturingDays;
return $this;
}
public function getOnRequestOnly(): ?bool
{
return $this->onRequestOnly;
}
public function setOnRequestOnly(bool $onRequestOnly): self
{
$this->onRequestOnly = $onRequestOnly;
return $this;
}
public function getProductGroup(): ?ProductGroup
{
return $this->productGroup;
}
public function setProductGroup(?ProductGroup $productGroup): self
{
$this->productGroup = $productGroup;
return $this;
}
public function getPosition() {
return $this->position;
}
public function setPosition($position) {
$this->position = $position;
}
}