1 | <?php |
||
19 | class ManyToMany extends AbstractRelation |
||
20 | { |
||
21 | use ManyTo, Owning, Ownable, Orderable, Indexable; |
||
22 | |||
23 | /** |
||
24 | * @var ManyToManyAssociationBuilder |
||
25 | */ |
||
26 | protected $association; |
||
27 | |||
28 | /** |
||
29 | * @param ClassMetadataBuilder $builder |
||
30 | * @param string $relation |
||
31 | * @param string $entity |
||
32 | * |
||
33 | * @return OneToManyAssociationBuilder |
||
34 | */ |
||
35 | 44 | protected function createAssociation(ClassMetadataBuilder $builder, $relation, $entity) |
|
39 | |||
40 | /** |
||
41 | * @param string $table |
||
42 | * |
||
43 | * @return $this |
||
44 | */ |
||
45 | 3 | public function joinTable($table) |
|
46 | { |
||
47 | 3 | $this->association->setJoinTable($table); |
|
48 | |||
49 | 3 | return $this; |
|
50 | } |
||
51 | |||
52 | /** |
||
53 | * @param string $joinColumn |
||
54 | * @param string $references |
||
55 | * @param bool $unique |
||
56 | * |
||
57 | * @return $this |
||
58 | */ |
||
59 | 8 | public function joinColumn($joinColumn, $references = 'id', $unique = false) |
|
60 | { |
||
61 | 8 | $this->addJoinColumn(null, $joinColumn, $references, false, $unique); |
|
62 | |||
63 | 8 | return $this; |
|
64 | } |
||
65 | |||
66 | /** |
||
67 | * @param string $foreignKey |
||
68 | * @param string $references |
||
69 | * @param bool $unique |
||
70 | * |
||
71 | * @return $this |
||
72 | */ |
||
73 | 2 | public function foreignKey($foreignKey, $references = 'id', $unique = false) |
|
77 | |||
78 | /** |
||
79 | * @param string $foreignKey |
||
80 | * @param string $references |
||
81 | * @param bool $unique |
||
82 | * |
||
83 | * @return $this |
||
84 | */ |
||
85 | 4 | public function source($foreignKey, $references = 'id', $unique = false) |
|
89 | |||
90 | /** |
||
91 | * @param string $inverseKey |
||
92 | * @param string $references |
||
93 | * @param bool $unique |
||
94 | * |
||
95 | * @return $this |
||
96 | */ |
||
97 | 5 | public function inverseKey($inverseKey, $references = 'id', $unique = false) |
|
98 | { |
||
99 | 5 | $this->association->addInverseJoinColumn($inverseKey, $references, false, $unique); |
|
100 | |||
101 | 5 | return $this; |
|
102 | } |
||
103 | |||
104 | /** |
||
105 | * @param string $inverseKey |
||
106 | * @param string $references |
||
107 | * @param bool $unique |
||
108 | * |
||
109 | * @return $this |
||
110 | */ |
||
111 | 3 | public function target($inverseKey, $references = 'id', $unique = false) |
|
115 | } |
||
116 |