/** * Method called to associate a ChildGroup object to this object * through the ChildGroup foreign key attribute. * * @param ChildGroup $l ChildGroup * @return $this|\Models\User The current object (for fluent API support) */ public function addMyGroup(ChildGroup $l) { if ($this->collMyGroups === null) { $this->initMyGroups(); $this->collMyGroupsPartial = true; } if (!$this->collMyGroups->contains($l)) { $this->doAddMyGroup($l); if ($this->myGroupsScheduledForDeletion and $this->myGroupsScheduledForDeletion->contains($l)) { $this->myGroupsScheduledForDeletion->remove($this->myGroupsScheduledForDeletion->search($l)); } } return $this; }