@@ 100-111 (lines=12) @@ | ||
97 | * |
|
98 | * @return OneToMany |
|
99 | */ |
|
100 | public function oneToMany($entity, $field = null, callable $callback = null) |
|
101 | { |
|
102 | return $this->addRelation( |
|
103 | new OneToMany( |
|
104 | $this->getBuilder(), |
|
105 | $this->getNamingStrategy(), |
|
106 | $this->guessPluralField($entity, $field), |
|
107 | $entity |
|
108 | ), |
|
109 | $callback |
|
110 | ); |
|
111 | } |
|
112 | ||
113 | /** |
|
114 | * @param string $entity |
|
@@ 132-143 (lines=12) @@ | ||
129 | * |
|
130 | * @return ManyToMany |
|
131 | */ |
|
132 | public function manyToMany($entity, $field = null, callable $callback = null) |
|
133 | { |
|
134 | return $this->addRelation( |
|
135 | new ManyToMany( |
|
136 | $this->getBuilder(), |
|
137 | $this->getNamingStrategy(), |
|
138 | $this->guessPluralField($entity, $field), |
|
139 | $entity |
|
140 | ), |
|
141 | $callback |
|
142 | ); |
|
143 | } |
|
144 | ||
145 | /** |
|
146 | * Adds a custom relation to the entity. |