public function get_related_badges(badge $badge) {
        global $DB;
        $arraybadges = array();
        $relatedbadges = $badge->get_related_badges(true);
        if ($relatedbadges) {
            foreach ($relatedbadges as $rb) {
                $url = new moodle_url('/badges/badge_json.php', array('id' => $rb->id));
                $arraybadges[] = array(
                    'id'        => $url->out(false),
                    'version'   => $rb->version,
                    '@language' => $rb->language
                );
            }
        }
        return $arraybadges;
    }
public function get_related_badges(badge $badge) {
        global $DB;
        $arraybadges = array();
        $relatedbadges = $badge->get_related_badges(true);
        if ($relatedbadges) {
            foreach ($relatedbadges as $rb) {
                $url = new moodle_url('/badges/badge_json.php', array('id' => $rb->id));
                $arraybadges[] = array(
                    'id'        => $url->out(false),
                    'version'   => $rb->version,
                    '@language' => $rb->language
                );
            }
        }
        return $arraybadges;
    }
public function get_related_badges ( badge $ badge ) { global $ DB ; $ arraybadges = array ( ) ; $ relatedbadges = $ badge -> get_related_badges ( true ) ; if ( $ relatedbadges ) { foreach ( $ relatedbadges as $ rb ) { $ url = new moodle_url ( '/badges/badge_json.php' , array ( 'id' => $ rb -> id ) ) ; $ arraybadges [ ] = array ( 'id' => $ url -> out ( false ) , 'version' => $ rb -> version , '@language' => $ rb -> language ) ; } } return $ arraybadges ; }
Get related badges of the badge.

@param badge $badge Badge object.
@return array|bool List related badges.
Get related badges of the badge .