Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // src/AppBundle/Entity/Categoria.php
- namespace AppBundle\Entity;
- use Doctrine\ORM\Mapping as ORM;
- use Doctrine\Common\Collections\ArrayCollection;
- /**
- * @ORM\Entity
- * @ORM\Table(name="Categoria")
- */
- class Categoria
- {
- /**
- * @ORM\Column(type="integer")
- * @ORM\Id
- * @ORM\GeneratedValue(strategy="AUTO")
- *
- */
- private $id;
- /**
- * @ORM\Column(type="string", length=100)
- */
- private $categoria;
- /**
- * @ORM\ManyToOne(targetEntity="Categoria", inversedBy="cat_figlie")
- *
- */
- private $madre;
- /**
- * @ORM\OneToMany(targetEntity="Articolo", mappedBy="categoria")
- */
- private $articoli;
- /**
- * @ORM\Column(type="text")
- */
- private $descrizione;
- /**
- *
- * @ORM\OneToMany(targetEntity="Categoria", mappedBy="madre")
- */
- private $cat_figlie;
- /**
- * @ORM\Column(type="boolean")
- */
- private $visibile; // visibile o non visibile
- /**
- * @ORM\Column(type="datetime")
- */
- private $created;
- public function __construct()
- {
- $this->cat_figlie = new ArrayCollection();
- $this->articoli = new ArrayCollection();
- $this->created = new \DateTime("now");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement