original_string: public function clear($cache_id, $options = array())
      {
          $result = null;
          $options += array('pattern' => '.cache');
          $this->hook->attach('cache.clear.before', $cache_id, $options, $result, $this);
  
          if (isset($result)) {
              return $result;
          }
  
          $result = true;
  
          if ($cache_id === null) {
              array_map('unlink', glob(GC_DIR_CACHE . '/*.cache'));
              gplcart_static_clear();
          } else {
  
              if (is_array($cache_id)) {
                  $cache_id = gplcart_array_hash($cache_id);
              }
  
              array_map('unlink', glob(GC_DIR_CACHE . "/$cache_id{$options['pattern']}"));
              gplcart_static_clear($cache_id);
          }
  
          $this->hook->attach('cache.clear.after', $cache_id, $options, $result, $this);
          return (bool) $result;
      }
code: public function clear($cache_id, $options = array())
      {
          $result = null;
          $options += array('pattern' => '.cache');
          $this->hook->attach('cache.clear.before', $cache_id, $options, $result, $this);
  
          if (isset($result)) {
              return $result;
          }
  
          $result = true;
  
          if ($cache_id === null) {
              array_map('unlink', glob(GC_DIR_CACHE . '/*.cache'));
              gplcart_static_clear();
          } else {
  
              if (is_array($cache_id)) {
                  $cache_id = gplcart_array_hash($cache_id);
              }
  
              array_map('unlink', glob(GC_DIR_CACHE . "/$cache_id{$options['pattern']}"));
              gplcart_static_clear($cache_id);
          }
  
          $this->hook->attach('cache.clear.after', $cache_id, $options, $result, $this);
          return (bool) $result;
      }
code_tokens: public function clear ( $ cache_id , $ options = array ( ) ) { $ result = null ; $ options += array ( 'pattern' => '.cache' ) ; $ this -> hook -> attach ( 'cache.clear.before' , $ cache_id , $ options , $ result , $ this ) ; if ( isset ( $ result ) ) { return $ result ; } $ result = true ; if ( $ cache_id === null ) { array_map ( 'unlink' , glob ( GC_DIR_CACHE . '/*.cache' ) ) ; gplcart_static_clear ( ) ; } else { if ( is_array ( $ cache_id ) ) { $ cache_id = gplcart_array_hash ( $ cache_id ) ; } array_map ( 'unlink' , glob ( GC_DIR_CACHE . "/$cache_id{$options['pattern']}" ) ) ; gplcart_static_clear ( $ cache_id ) ; } $ this -> hook -> attach ( 'cache.clear.after' , $ cache_id , $ options , $ result , $ this ) ; return ( bool ) $ result ; }
docstring: Clears a cached data
  @param string|null|array $cache_id
  @param array $options
  @return bool
docstring_tokens: Clears a cached data