src/Entity/PropertyDescription.php line 32

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Repository\PropertyDescriptionRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. /**
  8.  *  @ApiResource(
  9.  *     security= "is_granted('ROLE_AGENT') or is_granted('ROLE_MANAGER')",
  10.  *     normalizationContext={"groups"={"property-description:read"}, "swagger_definition_name"="Read"},
  11.  *     denormalizationContext={"groups"={"property-description:write"}, "swagger_definition_name"="Write"},
  12.  *     itemOperations={
  13.  *          "get",
  14.  *          "put" = {
  15.  *              "denormalization_context"={"groups"={"property-description:put"}},
  16.  *            },
  17.  *     },
  18.  *     collectionOperations={
  19.  *           "get",
  20.  *
  21.  *     },
  22.  *     attributes={
  23.  *          "pagination_items_per_page"=10,
  24.  *          "formats"={"jsonld", "json", "html", "jsonhal", "csv"={"text/csv"} }
  25.  *     }
  26.  * )
  27.  * @ORM\Entity(repositoryClass=PropertyDescriptionRepository::class)
  28.  */
  29. class PropertyDescription
  30. {
  31.     /**
  32.      * @ORM\Id
  33.      * @ORM\GeneratedValue
  34.      * @ORM\Column(type="integer")
  35.      *
  36.      * @Groups({
  37.      *    "property-description:read",
  38.      *    "property:read",
  39.      *    "mandate:read",
  40.      *    "transaction-item:read",
  41.      *    "milkiya:read"
  42.      * })
  43.      */
  44.     private $id;
  45.     /**
  46.      * @ORM\Column(type="string", length=255)
  47.      *
  48.      * @Groups({
  49.      *    "property-description:read","property-description:write","property-description:put",
  50.      *    "property:read","property:write","property:put",
  51.      *    "mandate:read",
  52.      *    "transaction-item:read",
  53.      *    "milkiya:read"
  54.      * })
  55.      */
  56.     private ?string $local;
  57.     /**
  58.      * @ORM\Column(type="text")
  59.      *
  60.      * @Groups({
  61.      *    "property-description:read","property-description:write","property-description:put",
  62.      *    "property:read","property:write","property:put",
  63.      *    "mandate:read",
  64.      *    "transaction-item:read",
  65.      *    "milkiya:read"
  66.      * })
  67.      */
  68.     private ?string $content;
  69.     /**
  70.      * @ORM\ManyToOne(targetEntity=Property::class, inversedBy="propertyDescriptions")
  71.      */
  72.     private ?Property $property;
  73.     public function getId(): ?int
  74.     {
  75.         return $this->id;
  76.     }
  77.     public function getLocal(): ?string
  78.     {
  79.         return $this->local;
  80.     }
  81.     public function setLocal(string $local): self
  82.     {
  83.         $this->local $local;
  84.         return $this;
  85.     }
  86.     public function getContent(): ?string
  87.     {
  88.         return $this->content;
  89.     }
  90.     public function setContent(string $content): self
  91.     {
  92.         $this->content $content;
  93.         return $this;
  94.     }
  95.     public function getProperty(): ?Property
  96.     {
  97.         return $this->property;
  98.     }
  99.     public function setProperty(?Property $property): self
  100.     {
  101.         $this->property $property;
  102.         return $this;
  103.     }
  104. }