src/Rbac/DbManager.php
public function getAssignments($userId)
    {
        if ($this->isEmptyUserId($userId)) {
            return resolve([]);
        }

        return (new Query())
            ->from($this->assignmentTable)
            ->where(['user_id' => (string)$userId])
            ->all($this->db)
            ->then(
                function($rows) {
                    $assignments = [];
                    foreach ($rows as $row) {
                        $assignments[$row['item_name']] = new Assignment([
                            'userId' => $row['user_id'],
                            'roleName' => $row['item_name'],
                            'createdAt' => $row['created_at'],
                        ]);
                    }

                    return $assignments;
                }
            );
    }
public function getAssignments($userId)
    {
        if ($this->isEmptyUserId($userId)) {
            return resolve([]);
        }

        return (new Query())
            ->from($this->assignmentTable)
            ->where(['user_id' => (string)$userId])
            ->all($this->db)
            ->then(
                function($rows) {
                    $assignments = [];
                    foreach ($rows as $row) {
                        $assignments[$row['item_name']] = new Assignment([
                            'userId' => $row['user_id'],
                            'roleName' => $row['item_name'],
                            'createdAt' => $row['created_at'],
                        ]);
                    }

                    return $assignments;
                }
            );
    }
{@inheritdoc}