src/Entity/BlogTagBlog.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\BlogTagBlogRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Entity(repositoryClass=BlogTagBlogRepository::class)
  7. */
  8. class BlogTagBlog
  9. {
  10. /**
  11. * @ORM\Id
  12. * @ORM\GeneratedValue
  13. * @ORM\Column(type="integer")
  14. */
  15. private $id;
  16. /**
  17. * @ORM\ManyToOne(targetEntity=Blog::class, inversedBy="tags")
  18. * @ORM\JoinColumn(nullable=false)
  19. */
  20. private $blog;
  21. /**
  22. * @ORM\ManyToOne(targetEntity=TagBlog::class)
  23. * @ORM\JoinColumn(nullable=false)
  24. */
  25. private $tag;
  26. /**
  27. * @ORM\Column(type="integer")
  28. */
  29. private $statut;
  30. public function getId(): ?int
  31. {
  32. return $this->id;
  33. }
  34. public function getBlog(): ?Blog
  35. {
  36. return $this->blog;
  37. }
  38. public function setBlog(?Blog $blog): self
  39. {
  40. $this->blog = $blog;
  41. return $this;
  42. }
  43. public function getTag(): ?TagBlog
  44. {
  45. return $this->tag;
  46. }
  47. public function setTag(?TagBlog $tag): self
  48. {
  49. $this->tag = $tag;
  50. return $this;
  51. }
  52. public function getStatut(): ?int
  53. {
  54. return $this->statut;
  55. }
  56. public function setStatut(int $statut): self
  57. {
  58. $this->statut = $statut;
  59. return $this;
  60. }
  61. public static function generateTagIdArray($tagArray){
  62. $result = [];
  63. foreach($tagArray as $tag){
  64. $result[] = $tag->getId();
  65. }
  66. return $result;
  67. }
  68. }