How to get user_ids into a plugin?

Description of issue or problem I’m having:

I try to develop a plugin that should list all copyeditors of our journal plus additional information. I know that the SQL-command “SELECT user_id FROM user_user_groups where user_group_id = 75” works in MySQL and returns the correct user_ids.

My problem is to get this working in a plugin. This is my very first attempt to develop a plugin. So, I am probably missing something very fundamental. I looked through the documentation and examples, but could not find the answer for my problem (or did not understand it).

Steps I took leading up to the issue:

I use the Authors History Plugin as a starting point and modify its file. The relevant code snippet:

class CopyeditorsHistoryDAO extends DAO {

public function getCopyeditorIds($code) {
    $authorsResult = $this->retrieve(
        "SELECT user_id FROM user_user_groups where user_group_id = 75");
    $authors = (new DAOResultFactory($authorsResult, $this, '_authorFromRow'))->toArray();
//        $authors = [111, 222, 333];
    return $authors;

What I tried to resolve the issue:

When I uncomment this explicit assignment to $authors, I get the expected result. I do not get the expected result from the SELECT statement, however.

I tested the SELECT statement in MySQL directly. I am sure, there is no error there.

Application Version - e.g., OJS 3.1.2:


Additional information, such as screenshots and error log messages if applicable:

Problem Solved

By peeking into some plugin code, rereading the documentation, and some trial and error, I managed to solve the problem.