public function add_related_badges($relatedids) {
        global $DB;
        $relatedbadges = array();
        foreach ($relatedids as $relatedid) {
            $relatedbadge = new stdClass();
            $relatedbadge->badgeid = $this->id;
            $relatedbadge->relatedbadgeid = $relatedid;
            $relatedbadges[] = $relatedbadge;
        }
        $DB->insert_records('badge_related', $relatedbadges);
    }
public function add_related_badges($relatedids) {
        global $DB;
        $relatedbadges = array();
        foreach ($relatedids as $relatedid) {
            $relatedbadge = new stdClass();
            $relatedbadge->badgeid = $this->id;
            $relatedbadge->relatedbadgeid = $relatedid;
            $relatedbadges[] = $relatedbadge;
        }
        $DB->insert_records('badge_related', $relatedbadges);
    }
public function add_related_badges ( $ relatedids ) { global $ DB ; $ relatedbadges = array ( ) ; foreach ( $ relatedids as $ relatedid ) { $ relatedbadge = new stdClass ( ) ; $ relatedbadge -> badgeid = $ this -> id ; $ relatedbadge -> relatedbadgeid = $ relatedid ; $ relatedbadges [ ] = $ relatedbadge ; } $ DB -> insert_records ( 'badge_related' , $ relatedbadges ) ; }
Add multiple related badges.

@param array $relatedids Id of badges.
Add multiple related badges .