original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Get related badges of the badge.
  
  @param badge $badge Badge object.
  @return array|bool List related badges.
docstring_tokens: Get related badges of the badge .