/** * @param UserGroup $userGroup The userGroup object to add. */ protected function doAddUserGroup($userGroup) { $this->collUserGroups[] = $userGroup; $userGroup->setGroup($this); }
/** * @param Group $group The group object to add. */ protected function doAddGroup(Group $group) { // set the back reference to this object directly as using provided method either results // in endless loop or in multiple relations if (!$group->getUsers()->contains($this)) { $userGroup = new UserGroup(); $userGroup->setGroup($group); $this->addUserGroup($userGroup); $foreignCollection = $group->getUsers(); $foreignCollection[] = $this; } }