Rapsys Git
/
airbundle
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace body with base template
[airbundle]
/
Entity
/
Dance.php
diff --git
a/Entity/Dance.php
b/Entity/Dance.php
index dccee339801f6dd00cec7c9a4bfc032bc4a212d5..796b81f20798f80239fca9dee7fee51ced9ce337 100644
(file)
--- a/
Entity/Dance.php
+++ b/
Entity/Dance.php
@@
-209,6
+209,9
@@
class Dance {
* @return Dance
*/
public function addUser(User $user): Dance {
* @return Dance
*/
public function addUser(User $user): Dance {
+ //Add from owning side
+ $user->addDance($this);
+
$this->users[] = $user;
return $this;
$this->users[] = $user;
return $this;
@@
-222,6
+225,13
@@
class Dance {
* @return bool
*/
public function removeUser(User $user): bool {
* @return bool
*/
public function removeUser(User $user): bool {
+ if (!$this->dances->contains($user)) {
+ return true;
+ }
+
+ //Remove from owning side
+ $user->removeDance($this);
+
return $this->users->removeElement($user);
}
return $this->users->removeElement($user);
}