Advertisement
Guest User

Categoria.php

a guest
Mar 21st, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. <?php
  2.  
  3. // src/AppBundle/Entity/Categoria.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="Categoria")
  13. */
  14. class Categoria
  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 $categoria;
  29.  
  30.  
  31. /**
  32. * @ORM\ManyToOne(targetEntity="Categoria", inversedBy="cat_figlie")
  33. *
  34. */
  35. private $madre;
  36.  
  37.  
  38. /**
  39. * @ORM\OneToMany(targetEntity="Articolo", mappedBy="categoria")
  40. */
  41. private $articoli;
  42.  
  43.  
  44. /**
  45. * @ORM\Column(type="text")
  46. */
  47. private $descrizione;
  48.  
  49.  
  50. /**
  51. *
  52. * @ORM\OneToMany(targetEntity="Categoria", mappedBy="madre")
  53. */
  54. private $cat_figlie;
  55.  
  56. /**
  57. * @ORM\Column(type="boolean")
  58. */
  59. private $visibile; // visibile o non visibile
  60.  
  61.  
  62.  
  63. /**
  64. * @ORM\Column(type="datetime")
  65. */
  66. private $created;
  67.  
  68.  
  69. public function __construct()
  70. {
  71. $this->cat_figlie = new ArrayCollection();
  72. $this->articoli = new ArrayCollection();
  73. $this->created = new \DateTime("now");
  74. }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement