@@ 8-24 (lines=17) @@ | ||
5 | /** |
|
6 | * Class CommentTransformer. |
|
7 | */ |
|
8 | class CommentTransformer extends Transformer |
|
9 | { |
|
10 | /** |
|
11 | * @param $comment |
|
12 | * |
|
13 | * @return array |
|
14 | */ |
|
15 | public function transform($comment) |
|
16 | { |
|
17 | return [ |
|
18 | 'id' => (int) $comment['id'], |
|
19 | 'user_id' => (int) $comment['user_id'], |
|
20 | 'video_id' => (int) $comment['video_id'], |
|
21 | 'comment' => $comment['comment'], |
|
22 | ]; |
|
23 | } |
|
24 | } |
|
25 |
@@ 8-23 (lines=16) @@ | ||
5 | /** |
|
6 | * Class LikeDislikeTransformer. |
|
7 | */ |
|
8 | class LikeDislikeTransformer extends Transformer |
|
9 | { |
|
10 | /** |
|
11 | * @param $likeDislike |
|
12 | * |
|
13 | * @return array |
|
14 | */ |
|
15 | public function transform($likeDislike) |
|
16 | { |
|
17 | return [ |
|
18 | 'user_id' => (int) $likeDislike['user_id'], |
|
19 | 'video_id' => (int) $likeDislike['video_id'], |
|
20 | 'type' => $likeDislike['type'], |
|
21 | ]; |
|
22 | } |
|
23 | } |
|
24 |