Made objects conversion methods public

This commit is contained in:
Pierre 2018-05-13 20:15:11 +02:00
parent 5ad0ae5c56
commit 21d00c0a00
2 changed files with 4 additions and 4 deletions

View File

@ -340,7 +340,7 @@ class friendsController{
* friendship should be returned or not
* @return array Informations about the friend readable by the api
*/
private function parseFriendAPI(Friend $friend, bool $all_infos = FALSE) : array {
public static function parseFriendAPI(Friend $friend, bool $all_infos = FALSE) : array {
//Parse informations about the friend
$data = array(

View File

@ -169,7 +169,7 @@ class userController
* @param User $user Information about the user
* @return array Information about the user compatible with the API
*/
public function userToAPI(User $user) : array {
public static function userToAPI(User $user) : array {
$data = array();
@ -190,9 +190,9 @@ class userController
* @param AdvancedUser $user Information about the user
* @return array Data compatible with the API
*/
private function advancedUserToAPI(AdvancedUser $user) : array {
public static function advancedUserToAPI(AdvancedUser $user) : array {
$data = $this->userToAPI($user);
$data = self::userToAPI($user);
$data['friend_list_public'] = $user->is_friendListPublic();
$data['personnalWebsite'] = $user->has_personnalWebsite() ? $user->get_personnalWebsite() : "";