1: <?php
2:
3:
4:
5:
6:
7: /**
8: * CommercialArticleCategory
9: *
10: * @Table(name="COMMERCIAL_ARTICLE_CATEGORY")
11: * @Entity
12: */
13: class CommercialArticleCategory
14: {
15: /**
16: * @var string $label
17: *
18: * @Column(name="label", type="string")
19: * @Id
20: * @GeneratedValue(strategy="IDENTITY")
21: */
22: private $label;
23:
24: /**
25: * @var \Doctrine\Common\Collections\ArrayCollection
26: *
27: * @ManyToMany(targetEntity="CommercialArticle", mappedBy="categoryLabel", orphanRemoval=true)
28: */
29: private $article;
30:
31: public function __construct()
32: {
33: $this->article = new \Doctrine\Common\Collections\ArrayCollection();
34: }
35:
36: /**
37: * Get label
38: *
39: * @return string
40: */
41: public function getLabel()
42: {
43: return $this->label;
44: }
45:
46: /**
47: * Add article
48: *
49: * @param CommercialArticle $article
50: * @return CommercialArticleCategory
51: */
52: public function addCommercialArticle(\CommercialArticle $article)
53: {
54: $this->article[] = $article;
55: return $this;
56: }
57:
58: /**
59: * Get article
60: *
61: * @return Doctrine\Common\Collections\Collection
62: */
63: public function getArticle()
64: {
65: return $this->article;
66: }
67: }