1<?php
2
3// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
4// See the LICENCE file in the repository root for full licence text.
5
6namespace App\Transformers;
7
8use App\Models\UserGroup;
9
10class UserGroupTransformer extends TransformerAbstract
11{
12 public function transform(UserGroup $userGroup)
13 {
14 // TODO: "group" should be an include. implemented like this for now
15 // to keep API backward-compatible
16 return array_merge(
17 json_item($userGroup->group, 'Group'),
18 ['playmodes' => $userGroup->playmodes],
19 );
20 }
21}