public function get_time_restriction_status() {
        if ($this->can_manage()) {
            return false;
        }

        if (!$this->is_accessible()) {
            if ($this->properties->deadline != 0 && time() > $this->properties->deadline) {
                $status = ['reason' => 'lessonclosed', 'time' => $this->properties->deadline];
            } else {
                $status = ['reason' => 'lessonopen', 'time' => $this->properties->available];
            }
            return (object) $status;
        }
        return false;
    }
public function get_time_restriction_status() {
        if ($this->can_manage()) {
            return false;
        }

        if (!$this->is_accessible()) {
            if ($this->properties->deadline != 0 && time() > $this->properties->deadline) {
                $status = ['reason' => 'lessonclosed', 'time' => $this->properties->deadline];
            } else {
                $status = ['reason' => 'lessonopen', 'time' => $this->properties->available];
            }
            return (object) $status;
        }
        return false;
    }
public function get_time_restriction_status ( ) { if ( $ this -> can_manage ( ) ) { return false ; } if ( ! $ this -> is_accessible ( ) ) { if ( $ this -> properties -> deadline != 0 && time ( ) > $ this -> properties -> deadline ) { $ status = [ 'reason' => 'lessonclosed' , 'time' => $ this -> properties -> deadline ] ; } else { $ status = [ 'reason' => 'lessonopen' , 'time' => $ this -> properties -> available ] ; } return ( object ) $ status ; } return false ; }
Check if time restriction is applied.

@return mixed false if  there aren't restrictions or an object with the restriction information
@since  Moodle 3.3
Check if time restriction is applied .