Airship\Cabin\Bridge\Blueprint\UserAccounts::getGroup PHP Method

getGroup() public method

public getGroup ( integer $groupId ) : array
$groupId integer
return array
    public function getGroup(int $groupId) : array
    {
        $group = $this->db->row('SELECT * FROM airship_groups WHERE groupid = ?', $groupId);
        if (empty($group)) {
            return [];
        }
        return $group;
    }

Usage Example

Example #1
0
 /**
  * Edit a group's information
  *
  * @route crew/groups/edit/{id}
  * @param string $groupId
  */
 public function editGroup(string $groupId = '')
 {
     $groupId = (int) $groupId;
     $post = $this->post(new EditGroupFilter());
     if (!empty($post)) {
         if ($this->account->editGroup($groupId, $post)) {
             \Airship\redirect($this->airship_cabin_prefix . '/crew/groups');
         }
     }
     $this->lens('crew/group_edit', ['active_link' => 'bridge-link-admin-crew-groups', 'group' => $this->account->getGroup($groupId), 'allowed_parents' => $this->account->getGroupTree(0, 'children', [$groupId])]);
 }