Ejemplo n.º 1
0
 /**
  * @param  ChildAction $action The ChildAction object to remove.
  * @return $this|ChildModule The current object (for fluent API support)
  */
 public function removeAction(ChildAction $action)
 {
     if ($this->getActions()->contains($action)) {
         $pos = $this->collActions->search($action);
         $this->collActions->remove($pos);
         if (null === $this->actionsScheduledForDeletion) {
             $this->actionsScheduledForDeletion = clone $this->collActions;
             $this->actionsScheduledForDeletion->clear();
         }
         $this->actionsScheduledForDeletion[] = clone $action;
         $action->setModule(null);
     }
     return $this;
 }
Ejemplo n.º 2
0
Archivo: Group.php Proyecto: keeko/core
 /**
  * Remove action of this object
  * through the kk_group_action cross reference table.
  *
  * @param ChildAction $action
  * @return ChildGroup The current object (for fluent API support)
  */
 public function removeAction(ChildAction $action)
 {
     if ($this->getActions()->contains($action)) {
         $groupAction = new ChildGroupAction();
         $groupAction->setAction($action);
         if ($action->isGroupsLoaded()) {
             //remove the back reference if available
             $action->getGroups()->removeObject($this);
         }
         $groupAction->setGroup($this);
         $this->removeGroupAction(clone $groupAction);
         $groupAction->clear();
         $this->collActions->remove($this->collActions->search($action));
         if (null === $this->actionsScheduledForDeletion) {
             $this->actionsScheduledForDeletion = clone $this->collActions;
             $this->actionsScheduledForDeletion->clear();
         }
         $this->actionsScheduledForDeletion->push($action);
     }
     return $this;
 }