File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace TapestryCloud \Database \Entities ;
4+
5+ /**
6+ * @Entity
7+ * @Table(name="classifications")
8+ */
9+ class Classification
10+ {
11+ /** @Id @Column(type="integer") @GeneratedValue */
12+ private $ id ;
13+
14+ /** @Column(type="string") */
15+ private $ name ;
16+
17+ /** @ManyToOne(targetEntity="Taxonomy") */
18+ private $ taxonomy ;
19+
20+ /**
21+ * @ManyToMany(targetEntity="Classification")
22+ * @JoinTable(name="files_classifications",
23+ * joinColumns={@JoinColumn(name="file_id", referencedColumnName="id")},
24+ * inverseJoinColumns={@JoinColumn(name="classification_id", referencedColumnName="id")}
25+ * )
26+ */
27+ private $ files ;
28+
29+ /**
30+ * @return string
31+ */
32+ public function getName ()
33+ {
34+ return $ this ->name ;
35+ }
36+
37+ public function setName ($ name )
38+ {
39+ $ this ->name = $ name ;
40+ }
41+ }
Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ class ContentType
2929 /** @Column(type="boolean") */
3030 private $ enabled ;
3131
32+ /** @OnetoMany(targetEntity="Taxonomy", mappedBy="content_type_id") */
33+ private $ taxonomy ;
34+
3235 /**
3336 * @return string
3437 */
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace TapestryCloud \Database \Entities ;
4+
5+ /**
6+ * @Entity
7+ * @Table(name="taxonomies")
8+ */
9+ class Taxonomy
10+ {
11+ /** @Id @Column(type="integer") @GeneratedValue */
12+ private $ id ;
13+
14+ /** @Column(type="string") */
15+ private $ name ;
16+
17+ /** @OnetoMany(targetEntity="Classification", mappedBy="taxonomy_id") */
18+ private $ classifications ;
19+
20+ /**
21+ * @return string
22+ */
23+ public function getName ()
24+ {
25+ return $ this ->name ;
26+ }
27+
28+ public function setName ($ name )
29+ {
30+ $ this ->name = $ name ;
31+ }
32+ }
You can’t perform that action at this time.
0 commit comments