src/Entity/Testimonial.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TestimonialRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClass: TestimonialRepository::class)]
  6. class Testimonial
  7. {
  8. #[ORM\Id]
  9. #[ORM\GeneratedValue]
  10. #[ORM\Column]
  11. private ?int $id = null;
  12. #[ORM\Column(length: 255)]
  13. private ?string $name = null;
  14. #[ORM\Column(type: 'text')]
  15. private ?string $content = null;
  16. #[ORM\Column(type: 'datetime')]
  17. private ?\DateTimeInterface $createdAt = null;
  18. #[ORM\Column(length: 255, nullable: true)]
  19. private ?string $image = null;
  20. #[ORM\Column(type: 'integer', options: ['default' => 5])]
  21. private int $rating = 5;
  22. public function __construct()
  23. {
  24. $this->createdAt = new \DateTime();
  25. }
  26. public function getId(): ?int
  27. {
  28. return $this->id;
  29. }
  30. public function getName(): ?string
  31. {
  32. return $this->name;
  33. }
  34. public function setName(string $name): self
  35. {
  36. $this->name = $name;
  37. return $this;
  38. }
  39. public function getContent(): ?string
  40. {
  41. return $this->content;
  42. }
  43. public function setContent(string $content): self
  44. {
  45. $this->content = $content;
  46. return $this;
  47. }
  48. public function getCreatedAt(): ?\DateTimeInterface
  49. {
  50. return $this->createdAt;
  51. }
  52. public function setCreatedAt(\DateTimeInterface $createdAt): self
  53. {
  54. $this->createdAt = $createdAt;
  55. return $this;
  56. }
  57. public function getImage(): ?string
  58. {
  59. return $this->image;
  60. }
  61. public function setImage(?string $image): self
  62. {
  63. $this->image = $image;
  64. return $this;
  65. }
  66. public function getRating(): int
  67. {
  68. return $this->rating;
  69. }
  70. public function setRating(int $rating): self
  71. {
  72. $this->rating = $rating;
  73. return $this;
  74. }
  75. }