Scalr\Acl\Acl::getUserRoleIdsByTeam PHP Method

getUserRoleIdsByTeam() public method

You cannot specify both userId and teamId with an array at the one call
public getUserRoleIdsByTeam ( integer | array $userId, integer | array $teamId, integer $accountId ) : array
$userId integer | array The ID of the user
$teamId integer | array The ID of the team
$accountId integer The ID of the client's account
return array Returns the list of the identifiers
    public function getUserRoleIdsByTeam($userId, $teamId, $accountId)
    {
        $ret = array();
        if (is_array($userId)) {
            $group = 'user_id';
            $subj = $userId;
        }
        if (is_array($teamId)) {
            if (isset($group)) {
                throw new \InvalidArgumentException("You cannot speciy both userId and teamId as array at the same time.");
            }
            $group = 'team_id';
            $subj = $teamId;
        }
        $lambda = function ($v) {
            return is_array($v) ? "IN ('" . join("', '", array_map('intval', $v)) . "')" : "=" . intval($v);
        };
        if (!empty($teamId) && !empty($userId)) {
            $rs = $this->db->Execute("\n                SELECT " . (isset($group) ? 'atu.' . $group . ',' : '') . " ar.account_role_id\n                FROM `acl_account_roles` ar\n                JOIN `account_team_user_acls` ua ON ua.`account_role_id` = ar.`account_role_id`\n                JOIN `account_team_users` atu ON atu.`id` = ua.`account_team_user_id`\n                WHERE atu.`user_id` " . $lambda($userId) . "\n                AND atu.`team_id` " . $lambda($teamId) . "\n                AND ar.`account_id` = ?\n                GROUP BY " . (isset($group) ? "atu." . $group . "," : "") . " ar.`account_role_id`\n            ", array($accountId));
            while ($rec = $rs->FetchRow()) {
                if (isset($group)) {
                    $ret[$rec[$group]][] = $rec['account_role_id'];
                } else {
                    $ret[] = $rec['account_role_id'];
                }
            }
        }
        if (isset($group)) {
            //users with missing ACL must be presented in the result array with empty result
            foreach ($subj as $id) {
                if (!isset($ret[$id])) {
                    $ret[$id] = array();
                }
            }
        }
        return $ret;
    }