1 | <?php |
||
52 | class DDC1925Product |
||
53 | { |
||
54 | /** |
||
55 | * @var int $id |
||
56 | * |
||
57 | * @Column(name="id", type="integer") |
||
58 | * @Id |
||
59 | * @GeneratedValue(strategy="AUTO") |
||
60 | */ |
||
61 | private $id; |
||
62 | |||
63 | /** |
||
64 | * @var string $title |
||
65 | * |
||
66 | * @Column(name="title", type="string", length=255) |
||
67 | */ |
||
68 | private $title; |
||
69 | |||
70 | /** |
||
71 | * @ManyToMany(targetEntity="DDC1925User") |
||
72 | * @JoinTable( |
||
73 | * name="user_purchases", |
||
74 | * joinColumns={@JoinColumn(name="product_id", referencedColumnName="id")}, |
||
75 | * inverseJoinColumns={@JoinColumn(name="user_id", referencedColumnName="id")} |
||
76 | * ) |
||
77 | */ |
||
78 | private $buyers; |
||
79 | |||
80 | /** |
||
81 | * Default constructor |
||
82 | */ |
||
83 | public function __construct() |
||
84 | { |
||
85 | $this->buyers = new ArrayCollection(); |
||
86 | } |
||
87 | |||
88 | /** |
||
89 | * @return int |
||
90 | */ |
||
91 | public function getId() |
||
92 | { |
||
93 | return $this->id; |
||
94 | } |
||
95 | |||
96 | /** |
||
97 | * @param string $title |
||
98 | */ |
||
99 | public function setTitle($title) |
||
100 | { |
||
101 | $this->title = $title; |
||
102 | } |
||
103 | |||
104 | /** |
||
105 | * Get title |
||
106 | * |
||
107 | * @return string |
||
108 | */ |
||
109 | public function getTitle() |
||
110 | { |
||
111 | return $this->title; |
||
112 | } |
||
113 | |||
114 | /** |
||
115 | * @return ArrayCollection |
||
116 | */ |
||
117 | public function getBuyers() |
||
121 | |||
122 | /** |
||
123 | * @param DDC1925User $buyer |
||
124 | */ |
||
125 | public function addBuyer(DDC1925User $buyer) |
||
129 | } |
||
130 | |||
131 | /** |
||
132 | * @Table |
||
133 | * @Entity |
||
183 |