public function is_discussion_time_locked(discussion_entity $discussion) : bool {
        if (!$this->has_lock_discussions_after()) {
            return false;
        }

        if ($this->get_type() === 'single') {
            // It does not make sense to lock a single discussion forum.
            return false;
        }

        return (($discussion->get_time_modified() + $this->get_lock_discussions_after()) < time());
    }
public function is_discussion_time_locked(discussion_entity $discussion) : bool {
        if (!$this->has_lock_discussions_after()) {
            return false;
        }

        if ($this->get_type() === 'single') {
            // It does not make sense to lock a single discussion forum.
            return false;
        }

        return (($discussion->get_time_modified() + $this->get_lock_discussions_after()) < time());
    }
public function is_discussion_time_locked ( discussion_entity $ discussion ) : bool { if ( ! $ this -> has_lock_discussions_after ( ) ) { return false ; } if ( $ this -> get_type ( ) === 'single' ) { // It does not make sense to lock a single discussion forum. return false ; } return ( ( $ discussion -> get_time_modified ( ) + $ this -> get_lock_discussions_after ( ) ) < time ( ) ) ; }
Check whether the discussion is locked based on forum's time based locking criteria

@param discussion_entity $discussion
@return bool
Check whether the discussion is locked based on forum s time based locking criteria