Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // src/AppBundle/Entity/Tag.php
- namespace AppBundle\Entity;
- use Doctrine\ORM\Mapping as ORM;
- use Doctrine\Common\Collections\ArrayCollection;
- /**
- * @ORM\Entity
- * @ORM\Table(name="Tag")
- */
- class Tag
- {
- /**
- * @ORM\Column(type="integer")
- * @ORM\Id
- * @ORM\GeneratedValue(strategy="AUTO")
- *
- */
- private $id;
- /**
- * @ORM\Column(type="string", length=100)
- */
- private $tag;
- /**
- * @ORM\Column(type="datetime")
- */
- private $creato;
- /**
- * @var \Doctrine\Common\Collections\ArrayCollection|Articoli[]
- * @ORM\ManyToMany(targetEntity="Articolo", inversedBy="tags")
- * @ORM\JoinTable(
- * name="tag_articoli",
- * joinColumns={
- * @ORM\JoinColumn(name="tag", referencedColumnName="id")
- * },
- * inverseJoinColumns={
- * @ORM\JoinColumn(name="articolo", referencedColumnName="id")
- * }
- * )
- */
- private $articoli;
- public function __construct()
- {
- $this->articoli = new ArrayCollection();
- $this->creato = new \DateTime("now");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement