mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-11-23 22:09:29 +00:00
Made objects conversion methods public
This commit is contained in:
parent
5ad0ae5c56
commit
21d00c0a00
@ -340,7 +340,7 @@ class friendsController{
|
|||||||
* friendship should be returned or not
|
* friendship should be returned or not
|
||||||
* @return array Informations about the friend readable by the api
|
* @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
|
//Parse informations about the friend
|
||||||
$data = array(
|
$data = array(
|
||||||
|
@ -169,7 +169,7 @@ class userController
|
|||||||
* @param User $user Information about the user
|
* @param User $user Information about the user
|
||||||
* @return array Information about the user compatible with the API
|
* @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();
|
$data = array();
|
||||||
|
|
||||||
@ -190,9 +190,9 @@ class userController
|
|||||||
* @param AdvancedUser $user Information about the user
|
* @param AdvancedUser $user Information about the user
|
||||||
* @return array Data compatible with the API
|
* @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['friend_list_public'] = $user->is_friendListPublic();
|
||||||
$data['personnalWebsite'] = $user->has_personnalWebsite() ? $user->get_personnalWebsite() : "";
|
$data['personnalWebsite'] = $user->has_personnalWebsite() ? $user->get_personnalWebsite() : "";
|
||||||
|
Loading…
Reference in New Issue
Block a user