public static function get_multiple_relations($competencyids) {
        global $DB;

        if (empty($competencyids)) {
            return array();
        }

        list($insql, $params) = $DB->get_in_or_equal($competencyids);

        $records = $DB->get_records_select(self::TABLE,
                                            "competencyid $insql OR relatedcompetencyid $insql",
                                            array_merge($params, $params)
                                            );

        $relatedcompetencies = array();
        foreach ($records as $record) {
            unset($record->id);
            $relatedcompetencies[] = new related_competency(null, $record);
        }
        return $relatedcompetencies;
    }
public static function get_multiple_relations($competencyids) {
        global $DB;

        if (empty($competencyids)) {
            return array();
        }

        list($insql, $params) = $DB->get_in_or_equal($competencyids);

        $records = $DB->get_records_select(self::TABLE,
                                            "competencyid $insql OR relatedcompetencyid $insql",
                                            array_merge($params, $params)
                                            );

        $relatedcompetencies = array();
        foreach ($records as $record) {
            unset($record->id);
            $relatedcompetencies[] = new related_competency(null, $record);
        }
        return $relatedcompetencies;
    }
public static function get_multiple_relations ( $ competencyids ) { global $ DB ; if ( empty ( $ competencyids ) ) { return array ( ) ; } list ( $ insql , $ params ) = $ DB -> get_in_or_equal ( $ competencyids ) ; $ records = $ DB -> get_records_select ( self :: TABLE , "competencyid $insql OR relatedcompetencyid $insql" , array_merge ( $ params , $ params ) ) ; $ relatedcompetencies = array ( ) ; foreach ( $ records as $ record ) { unset ( $ record -> id ) ; $ relatedcompetencies [ ] = new related_competency ( null , $ record ) ; } return $ relatedcompetencies ; }
Get the related competencies from competency ids.

@param  int[] $competencyids Array of competency ids.
@return related_competency[]
Get the related competencies from competency ids .