]>
Commit | Line | Data |
---|---|---|
9d50517c NL |
1 | <?php |
2 | ||
ad4d1caa | 3 | namespace Wallabag\CoreBundle\Entity; |
9d50517c NL |
4 | |
5 | use Doctrine\ORM\Mapping as ORM; | |
6d37a7e6 | 6 | use JMS\Serializer\Annotation\XmlRoot; |
0a018fe0 NL |
7 | use JMS\Serializer\Annotation\ExclusionPolicy; |
8 | use JMS\Serializer\Annotation\Expose; | |
9d50517c NL |
9 | |
10 | /** | |
653e8be4 | 11 | * Tag |
9d50517c | 12 | * |
6d37a7e6 | 13 | * @XmlRoot("tag") |
653e8be4 | 14 | * @ORM\Table(name="tag") |
6d37a7e6 | 15 | * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\TagRepository") |
0a018fe0 | 16 | * @ExclusionPolicy("all") |
9d50517c | 17 | */ |
653e8be4 | 18 | class Tag |
9d50517c NL |
19 | { |
20 | /** | |
21 | * @var integer | |
22 | * | |
0a018fe0 | 23 | * @Expose |
653e8be4 | 24 | * @ORM\Column(name="id", type="integer") |
9d50517c | 25 | * @ORM\Id |
653e8be4 | 26 | * @ORM\GeneratedValue(strategy="AUTO") |
9d50517c NL |
27 | */ |
28 | private $id; | |
29 | ||
30 | /** | |
31 | * @var string | |
32 | * | |
0a018fe0 | 33 | * @Expose |
653e8be4 | 34 | * @ORM\Column(name="label", type="text") |
9d50517c | 35 | */ |
653e8be4 | 36 | private $label; |
9d50517c | 37 | |
0a018fe0 NL |
38 | /** |
39 | * @ORM\ManyToMany(targetEntity="Entry", mappedBy="tags", cascade={"persist", "merge"}) | |
40 | */ | |
41 | private $entries; | |
42 | ||
9d50517c NL |
43 | /** |
44 | * Get id | |
45 | * | |
7df80cb3 | 46 | * @return integer |
9d50517c NL |
47 | */ |
48 | public function getId() | |
49 | { | |
50 | return $this->id; | |
51 | } | |
52 | ||
53 | /** | |
653e8be4 | 54 | * Set label |
9d50517c | 55 | * |
653e8be4 NL |
56 | * @param string $label |
57 | * @return Tag | |
9d50517c | 58 | */ |
653e8be4 | 59 | public function setLabel($label) |
9d50517c | 60 | { |
653e8be4 | 61 | $this->label = $label; |
9d50517c NL |
62 | |
63 | return $this; | |
64 | } | |
65 | ||
66 | /** | |
653e8be4 | 67 | * Get label |
9d50517c | 68 | * |
7df80cb3 | 69 | * @return string |
9d50517c | 70 | */ |
653e8be4 | 71 | public function getLabel() |
9d50517c | 72 | { |
2691cf04 | 73 | return $this->label; |
9d50517c NL |
74 | } |
75 | } |