original_string: public function set_locked(bool $locked) {
          global $DB;
  
          if ($this->_locked == $locked) {
              return $this;
          }
  
          $this->_locked = $locked;
          $DB->set_field('context', 'locked', (int) $locked, ['id' => $this->id]);
          $this->mark_dirty();
          self::reset_caches();
  
          return $this;
      }
code: public function set_locked(bool $locked) {
          global $DB;
  
          if ($this->_locked == $locked) {
              return $this;
          }
  
          $this->_locked = $locked;
          $DB->set_field('context', 'locked', (int) $locked, ['id' => $this->id]);
          $this->mark_dirty();
          self::reset_caches();
  
          return $this;
      }
code_tokens: public function set_locked ( bool $ locked ) { global $ DB ; if ( $ this -> _locked == $ locked ) { return $ this ; } $ this -> _locked = $ locked ; $ DB -> set_field ( 'context' , 'locked' , ( int ) $ locked , [ 'id' => $ this -> id ] ) ; $ this -> mark_dirty ( ) ; self :: reset_caches ( ) ; return $ this ; }
docstring: Set whether this context has been locked or not.
  
  @param   bool    $locked
  @return  $this
docstring_tokens: Set whether this context has been locked or not .