Advertisement
Guest User

Tag.php

a guest
Mar 21st, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. <?php
  2.  
  3. // src/AppBundle/Entity/Tag.php
  4. namespace AppBundle\Entity;
  5.  
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8.  
  9.  
  10. /**
  11. * @ORM\Entity
  12. * @ORM\Table(name="Tag")
  13. */
  14. class Tag
  15. {
  16. /**
  17. * @ORM\Column(type="integer")
  18. * @ORM\Id
  19. * @ORM\GeneratedValue(strategy="AUTO")
  20. *
  21. */
  22. private $id;
  23.  
  24.  
  25. /**
  26. * @ORM\Column(type="string", length=100)
  27. */
  28. private $tag;
  29.  
  30.  
  31. /**
  32. * @ORM\Column(type="datetime")
  33. */
  34. private $creato;
  35.  
  36.  
  37. /**
  38. * @var \Doctrine\Common\Collections\ArrayCollection|Articoli[]
  39. * @ORM\ManyToMany(targetEntity="Articolo", inversedBy="tags")
  40. * @ORM\JoinTable(
  41. * name="tag_articoli",
  42. * joinColumns={
  43. * @ORM\JoinColumn(name="tag", referencedColumnName="id")
  44. * },
  45. * inverseJoinColumns={
  46. * @ORM\JoinColumn(name="articolo", referencedColumnName="id")
  47. * }
  48. * )
  49. */
  50. private $articoli;
  51.  
  52. public function __construct()
  53. {
  54. $this->articoli = new ArrayCollection();
  55. $this->creato = new \DateTime("now");
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement