<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiProperty;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Repository\MatrixRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ORM\Entity(repositoryClass=MatrixRepository::class)
* @ApiResource(
* collectionOperations={"get","post"},
* itemOperations={"get","put","patch","delete"},
* normalizationContext={"groups"={"matrix"}},
* denormalizationContext={"groups"={"matrix"}},
* attributes={"pagination_enabled"=false}
* )
* @UniqueEntity("reference")
*/
class Matrix
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @ApiProperty(identifier=false)
*/
private $id;
/**
* @ORM\Column(type="string")
* @Groups("matrix")
*/
private $customerId;
/**
* @ORM\Column(type="string", length=60,unique=true)
* @Groups("matrix")
* @ApiProperty(identifier=true)
*/
private $reference;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups("matrix")
*/
private $deliveryAddress;
public function __construct()
{
}
public function getId(): ?int
{
return $this->id;
}
public function getCustomerId(): ?string
{
return $this->customerId;
}
public function setCustomerId(string $customerId): self
{
$this->customerId = $customerId;
return $this;
}
public function getReference(): ?string
{
return $this->reference;
}
public function setReference(string $reference): self
{
$this->reference = $reference;
return $this;
}
public function getDeliveryAddress(): ?string
{
return $this->deliveryAddress;
}
public function setDeliveryAddress(?string $deliveryAddress): self
{
$this->deliveryAddress = $deliveryAddress;
return $this;
}
}