Scalr_Account::getUsers PHP Method

getUsers() public method

public getUsers ( )
    public function getUsers()
    {
        $users = $this->db->GetAll('SELECT account_users.id, email, fullname, type, account_team_users.permissions FROM account_users
            LEFT JOIN account_team_users ON account_users.id = account_team_users.user_id WHERE account_id = ?', array($this->id));
        foreach ($users as &$user) {
            if ($user['permissions'] == 'owner') {
                $user['type'] = 'TeamOwner';
            }
        }
        return $users;
    }

Usage Example

Esempio n. 1
0
 public function xGetUsersAction()
 {
     $account = new Scalr_Account();
     $account->loadById($this->getParam('accountId'));
     $this->response->data(array('users' => $account->getUsers()));
 }