src/Entity/Forum/Post.php line 13

  1. <?php
  2. namespace App\Entity\Forum;
  3. use App\Entity\Traits\TrackerFields;
  4. use App\Entity\Traits\UserCreatedInterface;
  5. use App\Entity\Traits\UserUpdatedInterface;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Table(name'forum_post')]
  8. #[ORM\Entity(repositoryClass'App\Repository\Forum\PostRepository')]
  9. #[ORM\HasLifecycleCallbacks]
  10. class Post implements UserCreatedInterfaceUserUpdatedInterface
  11. {
  12.     use TrackerFields;
  13.     public const ADMIN_PER_PAGE 10;
  14.     /**
  15.      * @var int|null
  16.      */
  17.     #[ORM\Id]
  18.     #[ORM\GeneratedValue(strategy'AUTO')]
  19.     #[ORM\Column(type'integer')]
  20.     private $id;
  21.     /**
  22.      * @var string|null
  23.      */
  24.     #[ORM\Column(type'string')]
  25.     private $text;
  26.     /**
  27.      * @var Thread
  28.      */
  29.     #[ORM\ManyToOne(targetEntity'App\Entity\Forum\Thread'inversedBy'messages'cascade: ['persist'])]
  30.     #[ORM\JoinColumn(nullablefalse)]
  31.     private $thread;
  32.     /**
  33.      * @return int|null
  34.      */
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     /**
  40.      * @param int|null $id
  41.      */
  42.     public function setId(?int $id): void
  43.     {
  44.         $this->id $id;
  45.     }
  46.     /**
  47.      * @return string|null
  48.      */
  49.     public function getText(): ?string
  50.     {
  51.         return $this->text;
  52.     }
  53.     /**
  54.      * @param string|null $text
  55.      */
  56.     public function setText(?string $text): void
  57.     {
  58.         $this->text $text;
  59.     }
  60.     /**
  61.      * @return Thread
  62.      */
  63.     public function getThread(): Thread
  64.     {
  65.         return $this->thread;
  66.     }
  67.     /**
  68.      * @param Thread $thread
  69.      */
  70.     public function setThread(Thread $thread): void
  71.     {
  72.         $this->thread $thread;
  73.     }
  74. }