Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
B
Backend Server
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SpinShare
Backend Server
Commits
836bc284
Commit
836bc284
authored
Feb 22, 2021
by
Laura Heimann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adjusted getJSON functions for some entities to include paths to graphics
parent
5cb7f0b8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
3 deletions
+35
-3
src/Entity/Card.php
src/Entity/Card.php
+9
-0
src/Entity/SongPlaylist.php
src/Entity/SongPlaylist.php
+2
-1
src/Entity/User.php
src/Entity/User.php
+2
-2
src/Entity/UserCard.php
src/Entity/UserCard.php
+10
-0
src/Entity/UserNotification.php
src/Entity/UserNotification.php
+12
-0
No files found.
src/Entity/Card.php
View file @
836bc284
...
@@ -114,4 +114,13 @@ class Card
...
@@ -114,4 +114,13 @@ class Card
return
$this
;
return
$this
;
}
}
public
function
getJSON
()
{
return
array
(
'id'
=>
$this
->
id
,
'title'
=>
$this
->
title
,
'description'
=>
$this
->
description
,
'icon'
=>
$_ENV
[
'ASSET_BASE_URL'
]
.
DIRECTORY_SEPARATOR
.
$_ENV
[
'ASSET_CARD_FOLDER'
]
.
DIRECTORY_SEPARATOR
.
$this
->
icon
,
);
}
}
}
src/Entity/SongPlaylist.php
View file @
836bc284
...
@@ -147,7 +147,8 @@ class SongPlaylist
...
@@ -147,7 +147,8 @@ class SongPlaylist
'fileReference'
=>
$this
->
fileReference
,
'fileReference'
=>
$this
->
fileReference
,
'user'
=>
$this
->
user
->
getJSON
(),
'user'
=>
$this
->
user
->
getJSON
(),
'songs'
=>
$songs
,
'songs'
=>
$songs
,
'isOfficial'
=>
$this
->
isOfficial
'isOfficial'
=>
$this
->
isOfficial
,
'cover'
=>
$_ENV
[
'ASSET_BASE_URL'
]
.
DIRECTORY_SEPARATOR
.
$_ENV
[
'ASSET_COVER_FOLDER'
]
.
DIRECTORY_SEPARATOR
.
$this
->
fileReference
.
".png"
);
);
}
}
...
...
src/Entity/User.php
View file @
836bc284
...
@@ -193,10 +193,10 @@
...
@@ -193,10 +193,10 @@
return
array
(
return
array
(
'id'
=>
$this
->
id
,
'id'
=>
$this
->
id
,
'username'
=>
$this
->
username
,
'username'
=>
$this
->
username
,
'coverReference'
=>
$this
->
coverReference
,
'isVerified'
=>
$this
->
isVerified
,
'isVerified'
=>
$this
->
isVerified
,
'isPatreon'
=>
$this
->
isPatreon
,
'isPatreon'
=>
$this
->
isPatreon
,
'pronouns'
=>
$this
->
pronouns
'pronouns'
=>
$this
->
pronouns
,
'avatar'
=>
$_ENV
[
'ASSET_BASE_URL'
]
.
DIRECTORY_SEPARATOR
.
$_ENV
[
'ASSET_AVATAR_FOLDER'
]
.
DIRECTORY_SEPARATOR
.
$this
->
coverReference
);
);
}
}
...
...
src/Entity/UserCard.php
View file @
836bc284
...
@@ -72,4 +72,14 @@ class UserCard
...
@@ -72,4 +72,14 @@ class UserCard
return
$this
;
return
$this
;
}
}
public
function
getJSON
()
{
return
array
(
'id'
=>
$this
->
id
,
'icon'
=>
$_ENV
[
'ASSET_BASE_URL'
]
.
DIRECTORY_SEPARATOR
.
$_ENV
[
'ASSET_CARD_FOLDER'
]
.
DIRECTORY_SEPARATOR
.
$this
->
getCard
()
->
getIcon
(),
'title'
=>
$this
->
getCard
()
->
getTitle
(),
'givenDate'
=>
$this
->
getGivenDate
(),
'description'
=>
$this
->
getCard
()
->
getDescription
()
);
}
}
}
src/Entity/UserNotification.php
View file @
836bc284
...
@@ -122,4 +122,16 @@ class UserNotification
...
@@ -122,4 +122,16 @@ class UserNotification
return
$this
;
return
$this
;
}
}
public
function
getJSON
()
{
return
array
(
'id'
=>
$this
->
id
,
'user'
=>
$this
->
user
->
getJSON
(),
'notificationType'
=>
$this
->
notificationType
,
'notificationData'
=>
$this
->
notificationData
,
'connectedSong'
=>
$this
->
connectedSong
!=
null
?
$this
->
connectedSong
->
getJSON
()
:
null
,
'connectedUser'
=>
$this
->
connectedUser
!=
null
?
$this
->
connectedUser
->
getJSON
()
:
null
,
'connectedCard'
=>
$this
->
connectedCard
!=
null
?
$this
->
connectedCard
->
getJSON
()
:
null
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment