Пример #1
0
 /**
  * Remove group of this object
  * through the kk_group_action cross reference table.
  *
  * @param ChildGroup $group
  * @return ChildAction The current object (for fluent API support)
  */
 public function removeGroup(ChildGroup $group)
 {
     if ($this->getGroups()->contains($group)) {
         $groupAction = new ChildGroupAction();
         $groupAction->setGroup($group);
         if ($group->isActionsLoaded()) {
             //remove the back reference if available
             $group->getActions()->removeObject($this);
         }
         $groupAction->setAction($this);
         $this->removeGroupAction(clone $groupAction);
         $groupAction->clear();
         $this->collGroups->remove($this->collGroups->search($group));
         if (null === $this->groupsScheduledForDeletion) {
             $this->groupsScheduledForDeletion = clone $this->collGroups;
             $this->groupsScheduledForDeletion->clear();
         }
         $this->groupsScheduledForDeletion->push($group);
     }
     return $this;
 }