Commit 1dfa804
committed
minor #559 RFC: Always enforce updating inverse side for Comment (bocharsky-bw)
This PR was merged into the master branch.
Discussion
----------
RFC: Always enforce updating inverse side for Comment
It's an edge case, but what do you think about always updating inverse side in adder/remover methods?
For example, currently this code won't update inverse side properly:
```php
$comment = new Comment();
$post->getComments()->add($comment);
// but then if we will call adder method
$post->addComment($comment); // Comment::$post is still equals null here due to the failed `!contains()` check in it
```
Commits
-------
b5342c1 Always enforce updating inverse side for Comment1 file changed
+3
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| 206 | + | |
206 | 207 | | |
207 | 208 | | |
208 | | - | |
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
215 | | - | |
216 | | - | |
| 214 | + | |
| 215 | + | |
217 | 216 | | |
218 | 217 | | |
219 | 218 | | |
| |||
0 commit comments