*/
public function addUser(User $user): Dance {
//Add from owning side
- $user->addSubscriber($this);
+ $user->addDance($this);
$this->users[] = $user;
* @return bool
*/
public function removeUser(User $user): bool {
- if (!$this->users->contains($user)) {
+ if (!$this->dances->contains($user)) {
return true;
}
//Remove from owning side
- $user->removeSubscriber($this);
+ $user->removeDance($this);
return $this->users->removeElement($user);
}
*/
public function preUpdate(PreUpdateEventArgs $eventArgs) {
//Check that we have a dance instance
- if (($dance = $eventArgs->getEntity()) instanceof Dance) {
+ if (($dance = $eventArgs->getObject()) instanceof Dance) {
//Set updated value
$dance->setUpdated(new \DateTime('now'));
}