public function get_slot_by_number($slotnumber) {
        foreach ($this->slots as $slot) {
            if ($slot->slot == $slotnumber) {
                return $slot;
            }
        }

        throw new \coding_exception('The \'slotnumber\' could not be found.');
    }