<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Repository\CatalogRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ApiResource()
* @ORM\Entity(repositoryClass=CatalogRepository::class)
* @ApiResource(
* collectionOperations={"get","post"},
* itemOperations={"get","put","patch","delete"},
* normalizationContext={"groups"={"catalog"}},
* denormalizationContext={"groups"={"catalog"}},
* attributes={"pagination_enabled"=false}
* )
*/
class Catalog
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Article::class, inversedBy="catalogs")
* @ORM\JoinColumn(nullable=false)
* @Groups("catalog")
*/
private $article;
/**
* @ORM\Column(type="string", length=255)
* @Groups("catalog")
*/
private $customer;
public function getId(): ?int
{
return $this->id;
}
public function getArticle(): ?Article
{
return $this->article;
}
public function setArticle(?Article $article): self
{
$this->article = $article;
return $this;
}
public function getCustomer(): ?string
{
return $this->customer;
}
public function setCustomer(string $customer): self
{
$this->customer = $customer;
return $this;
}
}