src/Entity/Post.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PostRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use App\Entity\Article;
  7. #[ORM\Entity(repositoryClassPostRepository::class)]
  8. class Post
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(typeTypes::TEXT)]
  15.     private ?string $content null;
  16.     #[ORM\Column(length255nullabletrue)]
  17.     private ?string $image null;
  18.     #[ORM\ManyToOne(inversedBy'belongs')]
  19.     #[ORM\JoinColumn(nullablefalse)]
  20.     private ?Article $article null;
  21.     #[ORM\ManyToOne(inversedBy'posts')]
  22.     #[ORM\JoinColumn(nullablefalse)]
  23.     private ?User $user null;
  24.     public function getId(): ?int
  25.     {
  26.         return $this->id;
  27.     }
  28.     public function getContent(): ?string
  29.     {
  30.         return $this->content;
  31.     }
  32.     public function setContent(string $content): static
  33.     {
  34.         $this->content $content;
  35.         return $this;
  36.     }
  37.     public function getImage(): ?string
  38.     {
  39.         return $this->image;
  40.     }
  41.     public function setImage(?string $image): static
  42.     {
  43.         $this->image $image;
  44.         return $this;
  45.     }
  46.     public function getArticle(): ?Article
  47.     {
  48.         return $this->article;
  49.     }
  50.     public function setArticle(?Article $article): static
  51.     {
  52.         $this->article $article;
  53.         return $this;
  54.     }
  55.     public function getUser(): ?User
  56.     {
  57.         return $this->user;
  58.     }
  59.     public function setUser(?User $user): static
  60.     {
  61.         $this->user $user;
  62.         return $this;
  63.     }
  64.     
  65.     
  66.     
  67. }