<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Repository\PropertyDescriptionRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ApiResource(
* security= "is_granted('ROLE_AGENT') or is_granted('ROLE_MANAGER')",
* normalizationContext={"groups"={"property-description:read"}, "swagger_definition_name"="Read"},
* denormalizationContext={"groups"={"property-description:write"}, "swagger_definition_name"="Write"},
* itemOperations={
* "get",
* "put" = {
* "denormalization_context"={"groups"={"property-description:put"}},
* },
* },
* collectionOperations={
* "get",
*
* },
* attributes={
* "pagination_items_per_page"=10,
* "formats"={"jsonld", "json", "html", "jsonhal", "csv"={"text/csv"} }
* }
* )
* @ORM\Entity(repositoryClass=PropertyDescriptionRepository::class)
*/
class PropertyDescription
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*
* @Groups({
* "property-description:read",
* "property:read",
* "mandate:read",
* "transaction-item:read",
* "milkiya:read"
* })
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*
* @Groups({
* "property-description:read","property-description:write","property-description:put",
* "property:read","property:write","property:put",
* "mandate:read",
* "transaction-item:read",
* "milkiya:read"
* })
*/
private ?string $local;
/**
* @ORM\Column(type="text")
*
* @Groups({
* "property-description:read","property-description:write","property-description:put",
* "property:read","property:write","property:put",
* "mandate:read",
* "transaction-item:read",
* "milkiya:read"
* })
*/
private ?string $content;
/**
* @ORM\ManyToOne(targetEntity=Property::class, inversedBy="propertyDescriptions")
*/
private ?Property $property;
public function getId(): ?int
{
return $this->id;
}
public function getLocal(): ?string
{
return $this->local;
}
public function setLocal(string $local): self
{
$this->local = $local;
return $this;
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(string $content): self
{
$this->content = $content;
return $this;
}
public function getProperty(): ?Property
{
return $this->property;
}
public function setProperty(?Property $property): self
{
$this->property = $property;
return $this;
}
}