deleteGroup() public method

public deleteGroup ( integer $groupId, integer $newParent ) : boolean
$groupId integer
$newParent integer
return boolean
Example #1
0
 /**
  * @param string $groupId
  * @route crew/groups/edit/{id}
  */
 public function deleteGroup(string $groupId = '')
 {
     $groupId = (int) $groupId;
     $group = $this->account->getGroup($groupId);
     $post = $this->post(new DeleteGroupFilter());
     if ($post) {
         if ($this->account->deleteGroup($groupId, $post['move_children'] ?? 0)) {
             \Airship\redirect($this->airship_cabin_prefix . '/crew/groups');
         }
     }
     $this->lens('crew/group_delete', ['active_link' => 'bridge-link-admin-crew-groups', 'group' => $group, 'allowed_parents' => $this->account->getGroupTree(0, 'children', [$groupId])]);
 }