protected function processChannelsAndUsers(array $data, Result &$result)
    {

        // Let's add all of the channel information
        foreach ($data as $key => $value) {
            // We will handle these later
            if (in_array($key, ['channels', 'users'])) {
                // skip
                continue;
            }

            // Add the channel property as a team
            $result->addTeam($key, $value);
        }

        // Itereate over the users in this channel
        foreach ($data['users'] as $user) {
            foreach ($user as $key => $value) {
                $result->addPlayer($key, $value);
            }
        }

        // Offload more channels to parse
        foreach ($data['channels'] as $channel) {
            $this->processChannelsAndUsers($channel, $result);
        }
    }
protected function processChannelsAndUsers(array $data, Result &$result)
    {

        // Let's add all of the channel information
        foreach ($data as $key => $value) {
            // We will handle these later
            if (in_array($key, ['channels', 'users'])) {
                // skip
                continue;
            }

            // Add the channel property as a team
            $result->addTeam($key, $value);
        }

        // Itereate over the users in this channel
        foreach ($data['users'] as $user) {
            foreach ($user as $key => $value) {
                $result->addPlayer($key, $value);
            }
        }

        // Offload more channels to parse
        foreach ($data['channels'] as $channel) {
            $this->processChannelsAndUsers($channel, $result);
        }
    }
protected function processChannelsAndUsers ( array $ data , Result & $ result ) { // Let's add all of the channel information foreach ( $ data as $ key => $ value ) { // We will handle these later if ( in_array ( $ key , [ 'channels' , 'users' ] ) ) { // skip continue ; } // Add the channel property as a team $ result -> addTeam ( $ key , $ value ) ; } // Itereate over the users in this channel foreach ( $ data [ 'users' ] as $ user ) { foreach ( $ user as $ key => $ value ) { $ result -> addPlayer ( $ key , $ value ) ; } } // Offload more channels to parse foreach ( $ data [ 'channels' ] as $ channel ) { $ this -> processChannelsAndUsers ( $ channel , $ result ) ; } }
Handles processing the the channels and user info

@param array         $data
@param \GameQ\Result $result
Handles processing the the channels and user info