- <?php
- declare(strict_types = 1);
- namespace App\Domain\Entity;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\ORM\Mapping as ORM;
- use Symfony\Component\Validator\Constraints as Assert;
- /**
-  * Class Post.
-  *
-  * @ORM\Entity(repositoryClass="App\Domain\Repository\PostRepository")
-  * @ORM\Table(name="post_tracol")
-  */
- class Post extends AbstractEntity
- {
-     /**
-      *
-      * @ORM\Column(type="string")
-      * @Assert\NotBlank(message="Veuillez renseigner les champs vides")
-      */
-     public string $name;
-     /**
-      *
-      * @ORM\Column(type="text")
-      * @Assert\NotBlank(message="Veuillez renseigner les champs vides")
-      */
-     protected string $content;
-     /**
-      *
-      * @ORM\ManyToMany(targetEntity="App\Domain\Entity\Picture", cascade={"remove"}, cascade={"persist"},  orphanRemoval=true)
-      * @ORM\JoinTable(name="post_pictures",
-      *     joinColumns={@ORM\JoinColumn(referencedColumnName="id", name="post_id")},
-      *     inverseJoinColumns={@ORM\JoinColumn(referencedColumnName="id", name="picture_id")}
-      *     )
-      */
-     protected $picture;
-     /**
-      * @ORM\ManyToOne(targetEntity="App\Domain\Entity\Tag", cascade={"persist"})
-      */
-     protected Tag $tag;
-     public function __construct(
-     ) {
-         $this->picture = new ArrayCollection();
-         $this->createdAt = time();
-         parent::__construct();
-     }
-     public function getName(): string
-     {
-         return $this->name;
-     }
-     public function setName(string $name): Post
-     {
-         $this->name = $name;
-         return $this;
-     }
-     public function getContent(): string
-     {
-         return $this->content;
-     }
-     public function setContent(string $content): Post
-     {
-         $this->content = $content;
-         return $this;
-     }
-     public function getPicture()
-     {
-         return $this->picture;
-     }
-     public function setPicture($picture): Post
-     {
-         $this->picture = $picture;
-         return $this;
-     }
-     public function getTag(): Tag
-     {
-         return $this->tag;
-     }
-     public function setTag(Tag $tag): Post
-     {
-         $this->tag = $tag;
-         return $this;
-     }
- }
-