original_string: protected function get_search_area($areaid) {
  
          if (isset($this->cachedareas[$areaid]) && $this->cachedareas[$areaid] === false) {
              // We already checked that area and it is not available.
              return false;
          }
  
          if (!isset($this->cachedareas[$areaid])) {
              // First result that matches this area.
  
              $this->cachedareas[$areaid] = \core_search\manager::get_search_area($areaid);
              if ($this->cachedareas[$areaid] === false) {
                  // The area does not exist or it is not available any more.
  
                  $this->cachedareas[$areaid] = false;
                  return false;
              }
  
              if (!$this->cachedareas[$areaid]->is_enabled()) {
                  // We skip the area if it is not enabled.
  
                  // Marking it as false so next time we don' need to check it again.
                  $this->cachedareas[$areaid] = false;
  
                  return false;
              }
          }
  
          return $this->cachedareas[$areaid];
      }
code: protected function get_search_area($areaid) {
  
          if (isset($this->cachedareas[$areaid]) && $this->cachedareas[$areaid] === false) {
              // We already checked that area and it is not available.
              return false;
          }
  
          if (!isset($this->cachedareas[$areaid])) {
              // First result that matches this area.
  
              $this->cachedareas[$areaid] = \core_search\manager::get_search_area($areaid);
              if ($this->cachedareas[$areaid] === false) {
                  // The area does not exist or it is not available any more.
  
                  $this->cachedareas[$areaid] = false;
                  return false;
              }
  
              if (!$this->cachedareas[$areaid]->is_enabled()) {
                  // We skip the area if it is not enabled.
  
                  // Marking it as false so next time we don' need to check it again.
                  $this->cachedareas[$areaid] = false;
  
                  return false;
              }
          }
  
          return $this->cachedareas[$areaid];
      }
code_tokens: protected function get_search_area ( $ areaid ) { if ( isset ( $ this -> cachedareas [ $ areaid ] ) && $ this -> cachedareas [ $ areaid ] === false ) { // We already checked that area and it is not available. return false ; } if ( ! isset ( $ this -> cachedareas [ $ areaid ] ) ) { // First result that matches this area. $ this -> cachedareas [ $ areaid ] = \ core_search \ manager :: get_search_area ( $ areaid ) ; if ( $ this -> cachedareas [ $ areaid ] === false ) { // The area does not exist or it is not available any more. $ this -> cachedareas [ $ areaid ] = false ; return false ; } if ( ! $ this -> cachedareas [ $ areaid ] -> is_enabled ( ) ) { // We skip the area if it is not enabled. // Marking it as false so next time we don' need to check it again. $ this -> cachedareas [ $ areaid ] = false ; return false ; } } return $ this -> cachedareas [ $ areaid ] ; }
docstring: Returns a search instance of the specified area checking internal caching.
  
  @param string $areaid Area id
  @return \core_search\base
docstring_tokens: Returns a search instance of the specified area checking internal caching .