src/HabboParser.php
public function parseProfile($id)
    {
        // Collect JSON
        list($data) = $this->_callUrl($this->api_base . '/api/public/users/' . $id . '/profile', true);

        // Create Profile entity
        $profile = new Profile();

        // Habbo
        $habbo = new Habbo();
        $habbo->parse($data['user']);
        $profile->setHabbo($habbo);

        // Friends
        foreach ($data['friends'] as $friend) {
            $temp_friend = new Habbo();
            $temp_friend->parse($friend);
            $profile->addFriend($temp_friend);
        }

        // Groups
        foreach ($data['groups'] as $group) {
            $temp_group = new Group();
            $temp_group->parse($group);
            $profile->addGroup($temp_group);
        }

        // Rooms
        foreach ($data['rooms'] as $room) {
            $temp_room = new Room();
            $temp_room->parse($room);
            $profile->addRoom($temp_room);
        }

        // Badges
        foreach ($data['badges'] as $badge) {
            $temp_badge = new Badge();
            $temp_badge->parse($badge);
            $profile->addBadge($temp_badge);
        }

        // Return the Profile
        return $profile;
    }
public function parseProfile($id)
    {
        // Collect JSON
        list($data) = $this->_callUrl($this->api_base . '/api/public/users/' . $id . '/profile', true);

        // Create Profile entity
        $profile = new Profile();

        // Habbo
        $habbo = new Habbo();
        $habbo->parse($data['user']);
        $profile->setHabbo($habbo);

        // Friends
        foreach ($data['friends'] as $friend) {
            $temp_friend = new Habbo();
            $temp_friend->parse($friend);
            $profile->addFriend($temp_friend);
        }

        // Groups
        foreach ($data['groups'] as $group) {
            $temp_group = new Group();
            $temp_group->parse($group);
            $profile->addGroup($temp_group);
        }

        // Rooms
        foreach ($data['rooms'] as $room) {
            $temp_room = new Room();
            $temp_room->parse($room);
            $profile->addRoom($temp_room);
        }

        // Badges
        foreach ($data['badges'] as $badge) {
            $temp_badge = new Badge();
            $temp_badge->parse($badge);
            $profile->addBadge($temp_badge);
        }

        // Return the Profile
        return $profile;
    }
public function parseProfile ( $ id ) { // Collect JSON list ( $ data ) = $ this -> _callUrl ( $ this -> api_base . '/api/public/users/' . $ id . '/profile' , true ) ; // Create Profile entity $ profile = new Profile ( ) ; // Habbo $ habbo = new Habbo ( ) ; $ habbo -> parse ( $ data [ 'user' ] ) ; $ profile -> setHabbo ( $ habbo ) ; // Friends foreach ( $ data [ 'friends' ] as $ friend ) { $ temp_friend = new Habbo ( ) ; $ temp_friend -> parse ( $ friend ) ; $ profile -> addFriend ( $ temp_friend ) ; } // Groups foreach ( $ data [ 'groups' ] as $ group ) { $ temp_group = new Group ( ) ; $ temp_group -> parse ( $ group ) ; $ profile -> addGroup ( $ temp_group ) ; } // Rooms foreach ( $ data [ 'rooms' ] as $ room ) { $ temp_room = new Room ( ) ; $ temp_room -> parse ( $ room ) ; $ profile -> addRoom ( $ temp_room ) ; } // Badges foreach ( $ data [ 'badges' ] as $ badge ) { $ temp_badge = new Badge ( ) ; $ temp_badge -> parse ( $ badge ) ; $ profile -> addBadge ( $ temp_badge ) ; } // Return the Profile return $ profile ; }
Parses the Habbo Profile endpoints

Return a Profile object including a Habbo entity and 4 arrays with Group, Friend, Room, Badge entities

@param string $id
@return Profile
@throws Exception
Parses the Habbo Profile endpoints