private function get_available() {
        global $CFG;
        $userid = $this->modinfo->get_user_id();
        if ($this->_available !== null || $userid == -1) {
            // Has already been calculated or does not need calculation.
            return $this->_available;
        }
        $this->_available = true;
        $this->_availableinfo = '';
        if (!empty($CFG->enableavailability)) {
            // Get availability information.
            $ci = new \core_availability\info_section($this);
            $this->_available = $ci->is_available($this->_availableinfo, true,
                    $userid, $this->modinfo);
        }
        // Execute the hook from the course format that may override the available/availableinfo properties.
        $currentavailable = $this->_available;
        course_get_format($this->modinfo->get_course())->
            section_get_available_hook($this, $this->_available, $this->_availableinfo);
        if (!$currentavailable && $this->_available) {
            debugging('section_get_available_hook() can not make unavailable section available', DEBUG_DEVELOPER);
            $this->_available = $currentavailable;
        }
        return $this->_available;
    }
private function get_available() {
        global $CFG;
        $userid = $this->modinfo->get_user_id();
        if ($this->_available !== null || $userid == -1) {
            // Has already been calculated or does not need calculation.
            return $this->_available;
        }
        $this->_available = true;
        $this->_availableinfo = '';
        if (!empty($CFG->enableavailability)) {
            // Get availability information.
            $ci = new \core_availability\info_section($this);
            $this->_available = $ci->is_available($this->_availableinfo, true,
                    $userid, $this->modinfo);
        }
        // Execute the hook from the course format that may override the available/availableinfo properties.
        $currentavailable = $this->_available;
        course_get_format($this->modinfo->get_course())->
            section_get_available_hook($this, $this->_available, $this->_availableinfo);
        if (!$currentavailable && $this->_available) {
            debugging('section_get_available_hook() can not make unavailable section available', DEBUG_DEVELOPER);
            $this->_available = $currentavailable;
        }
        return $this->_available;
    }
private function get_available ( ) { global $ CFG ; $ userid = $ this -> modinfo -> get_user_id ( ) ; if ( $ this -> _available !== null || $ userid == - 1 ) { // Has already been calculated or does not need calculation. return $ this -> _available ; } $ this -> _available = true ; $ this -> _availableinfo = '' ; if ( ! empty ( $ CFG -> enableavailability ) ) { // Get availability information. $ ci = new \ core_availability \ info_section ( $ this ) ; $ this -> _available = $ ci -> is_available ( $ this -> _availableinfo , true , $ userid , $ this -> modinfo ) ; } // Execute the hook from the course format that may override the available/availableinfo properties. $ currentavailable = $ this -> _available ; course_get_format ( $ this -> modinfo -> get_course ( ) ) -> section_get_available_hook ( $ this , $ this -> _available , $ this -> _availableinfo ) ; if ( ! $ currentavailable && $ this -> _available ) { debugging ( 'section_get_available_hook() can not make unavailable section available' , DEBUG_DEVELOPER ) ; $ this -> _available = $ currentavailable ; } return $ this -> _available ; }
Finds whether this section is available at the moment for the current user.

The value can be accessed publicly as $sectioninfo->available

@return bool
Finds whether this section is available at the moment for the current user .