Commit 836bc284 authored by Laura Heimann's avatar Laura Heimann

adjusted getJSON functions for some entities to include paths to graphics

parent 5cb7f0b8
...@@ -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,
);
}
} }
...@@ -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"
); );
} }
......
...@@ -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
); );
} }
......
...@@ -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()
);
}
} }
...@@ -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
);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment