<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiFilter;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Repository\ProductRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
/**
* @ApiResource(normalizationContext={"groups"={"Product_read"}},
* itemOperations={"get"},
* collectionOperations={"get"})
* @ApiFilter(SearchFilter::class, properties={
* "colour": "exact",
* "category": "exact",
* "manufacturer": "exact",
* })
* @ORM\Entity(repositoryClass=ProductRepository::class)
*/
class Product
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Groups({"Product_read"})
*/
private $id;
/**
* @Groups({"Product_read"})
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @Groups({"Product_read"})
* @ORM\Column(type="string", length=255)
*/
private $image;
/**
* @Groups({"Product_read"})
* @ORM\Column(type="string", length=255)
*/
private $articlenumber;
/**
* @Groups({"Product_read"})
* @ORM\Column(type="string", length=255)
*/
private $numberofremaining;
/**
* @Groups({"Product_read"})
* @ORM\Column(type="text")
*/
private $description;
/**
* @Groups({"Product_read"})
* @ORM\Column(type="string", length=255)
*/
private $price;
/**
* @Groups({"Product_read"})
* @ORM\Column(type="string", length=255)
*/
private $timeofdelivery;
/**
* @ORM\ManyToOne(targetEntity=Colour::class, inversedBy="products")
* @ORM\JoinColumn(nullable=false)
*/
private $colour;
/**
* @ORM\ManyToOne(targetEntity=Model::class, inversedBy="products")
* @ORM\JoinColumn(nullable=false)
*/
private $model;
/**
* @ORM\ManyToOne(targetEntity=Manufacturer::class, inversedBy="products")
* @ORM\JoinColumn(nullable=false)
*/
private $manufacturer;
/**
* @ORM\ManyToOne(targetEntity=OperatingSystem::class, inversedBy="products")
* @ORM\JoinColumn(nullable=false)
*/
private $operatingSystem;
/**
* @ORM\ManyToOne(targetEntity=Pfunctions::class, inversedBy="products")
* @ORM\JoinColumn(nullable=false)
*/
private $functions;
/**
* @ORM\ManyToOne(targetEntity=Printerseries::class, inversedBy="products")
* @ORM\JoinColumn(nullable=false)
*/
private $series;
/**
* @ORM\ManyToOne(targetEntity=Ink::class, inversedBy="products")
* @ORM\JoinColumn(nullable=false)
*/
private $ink;
/**
* @ORM\ManyToOne(targetEntity=Printerspeed::class, inversedBy="products")
* @ORM\JoinColumn(nullable=false)
*/
private $speed;
/**
* @ORM\ManyToOne(targetEntity=Connection::class, inversedBy="products")
* @ORM\JoinColumn(nullable=false)
*/
private $connection;
/**
* @ORM\ManyToOne(targetEntity=Papersize::class, inversedBy="products")
* @ORM\JoinColumn(nullable=false)
*/
private $size;
/**
* @ORM\ManyToOne(targetEntity=Paperstock::class)
* @ORM\JoinColumn(nullable=false)
*/
private $stock;
/**
* @ORM\ManyToOne(targetEntity=Fieldofuse::class, inversedBy="products")
* @ORM\JoinColumn(nullable=false)
*/
private $fieldofuse;
/**
* @ORM\ManyToOne(targetEntity=Resolutions::class, inversedBy="products")
* @ORM\JoinColumn(nullable=false)
*/
private $resolution;
/**
* @ORM\ManyToOne(targetEntity=Duplexprinting::class, inversedBy="products")
* @ORM\JoinColumn(nullable=false)
*/
private $duplexprinting;
/**
* @ORM\Column(type="datetime_immutable")
*/
private $createdAt;
/**
* @ORM\Column(type="datetime_immutable")
*/
private $updatedAt;
/**
* @ORM\ManyToOne(targetEntity=Category::class, inversedBy="products")
*/
private $category;
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getImage(): ?string
{
return $this->image;
}
public function setImage(string $image): self
{
$this->image = $image;
return $this;
}
public function getArticlenumber(): ?string
{
return $this->articlenumber;
}
public function setArticlenumber(string $articlenumber): self
{
$this->articlenumber = $articlenumber;
return $this;
}
public function getNumberofremaining(): ?string
{
return $this->numberofremaining;
}
public function setNumberofremaining(string $numberofremaining): self
{
$this->numberofremaining = $numberofremaining;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(string $description): self
{
$this->description = $description;
return $this;
}
public function getPrice(): ?string
{
return $this->price;
}
public function setPrice(string $price): self
{
$this->price = $price;
return $this;
}
public function getTimeofdelivery(): ?string
{
return $this->timeofdelivery;
}
public function setTimeofdelivery(string $timeofdelivery): self
{
$this->timeofdelivery = $timeofdelivery;
return $this;
}
public function getColour(): ?Colour
{
return $this->colour;
}
public function setColour(?Colour $colour): self
{
$this->colour = $colour;
return $this;
}
public function getModel(): ?Model
{
return $this->model;
}
public function setModel(?Model $model): self
{
$this->model = $model;
return $this;
}
public function getManufacturer(): ?Manufacturer
{
return $this->manufacturer;
}
public function setManufacturer(?Manufacturer $manufacturer): self
{
$this->manufacturer = $manufacturer;
return $this;
}
public function getOperatingSystem(): ?OperatingSystem
{
return $this->operatingSystem;
}
public function setOperatingSystem(?OperatingSystem $operatingSystem): self
{
$this->operatingSystem = $operatingSystem;
return $this;
}
public function getFunctions(): ?Pfunctions
{
return $this->functions;
}
public function setFunctions(?Pfunctions $functions): self
{
$this->functions = $functions;
return $this;
}
public function getSeries(): ?Printerseries
{
return $this->series;
}
public function setSeries(?Printerseries $series): self
{
$this->series = $series;
return $this;
}
public function getInk(): ?Ink
{
return $this->ink;
}
public function setInk(?Ink $ink): self
{
$this->ink = $ink;
return $this;
}
public function getSpeed(): ?Printerspeed
{
return $this->speed;
}
public function setSpeed(?Printerspeed $speed): self
{
$this->speed = $speed;
return $this;
}
public function getConnection(): ?Connection
{
return $this->connection;
}
public function setConnection(?Connection $connection): self
{
$this->connection = $connection;
return $this;
}
public function getSize(): ?Papersize
{
return $this->size;
}
public function setSize(?Papersize $size): self
{
$this->size = $size;
return $this;
}
public function getStock(): ?Paperstock
{
return $this->stock;
}
public function setStock(?Paperstock $stock): self
{
$this->stock = $stock;
return $this;
}
public function getFieldofuse(): ?Fieldofuse
{
return $this->fieldofuse;
}
public function setFieldofuse(?Fieldofuse $fieldofuse): self
{
$this->fieldofuse = $fieldofuse;
return $this;
}
public function getResolution(): ?Resolutions
{
return $this->resolution;
}
public function setResolution(?Resolutions $resolution): self
{
$this->resolution = $resolution;
return $this;
}
public function getDuplexprinting(): ?Duplexprinting
{
return $this->duplexprinting;
}
public function setDuplexprinting(?Duplexprinting $duplexprinting): self
{
$this->duplexprinting = $duplexprinting;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeImmutable
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTimeImmutable $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getCategory(): ?Category
{
return $this->category;
}
public function setCategory(?Category $category): self
{
$this->category = $category;
return $this;
}
}