protected function build_limitcourseids(\stdClass $formdata) {
        $limitcourseids = false;

        if (!empty($formdata->mycoursesonly)) {
            $limitcourseids = array_keys($this->get_my_courses(false));
        }

        if (!empty($formdata->courseids)) {
            if (empty($limitcourseids)) {
                $limitcourseids = $formdata->courseids;
            } else {
                $limitcourseids = array_intersect($limitcourseids, $formdata->courseids);
            }
        }

        return $limitcourseids;
    }
protected function build_limitcourseids(\stdClass $formdata) {
        $limitcourseids = false;

        if (!empty($formdata->mycoursesonly)) {
            $limitcourseids = array_keys($this->get_my_courses(false));
        }

        if (!empty($formdata->courseids)) {
            if (empty($limitcourseids)) {
                $limitcourseids = $formdata->courseids;
            } else {
                $limitcourseids = array_intersect($limitcourseids, $formdata->courseids);
            }
        }

        return $limitcourseids;
    }
protected function build_limitcourseids ( \ stdClass $ formdata ) { $ limitcourseids = false ; if ( ! empty ( $ formdata -> mycoursesonly ) ) { $ limitcourseids = array_keys ( $ this -> get_my_courses ( false ) ) ; } if ( ! empty ( $ formdata -> courseids ) ) { if ( empty ( $ limitcourseids ) ) { $ limitcourseids = $ formdata -> courseids ; } else { $ limitcourseids = array_intersect ( $ limitcourseids , $ formdata -> courseids ) ; } } return $ limitcourseids ; }
Build a list of course ids to limit the search based on submitted form data.

@param \stdClass $formdata Submitted search form data.

@return array|bool
Build a list of course ids to limit the search based on submitted form data .