コード例 #1
0
ファイル: Module.php プロジェクト: keeko/core
 /**
  * @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;
 }
コード例 #2
0
ファイル: Group.php プロジェクト: 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;
 }