function DrupalDatabaseCach8b7c:f320:99b9:690f:4595:cd17:293a:c069isValidBin DrupalDatabaseCach8b7c:f320:99b9:690f:4595:cd17:293a:c069isValidBin() Checks if $this->bin represents a valid cache table. This check is required to ensure that non-cache tables are not truncated accidentally when calling cache_clear_all(). Return value  boolean File
 includes/cache.inc, line 568 Functions and interfaces for cache handling.  Class
 
DrupalDatabaseCache  Defines a default cache implementation.  Code function isValidBin() {
  if ($this->bin == 'cache' || substr($this->bin, 0, 6) == 'cache_') {
    // Skip schema check for bins with standard table names.
    return TRUE;
  }
  // These fields are required for any cache table.
  $fields = array('cid', 'data', 'expire', 'created', 'serialized');
  // Load the table schema.
  $schema = drupal_get_schema($this->bin);
  // Confirm that all fields are present.
  return isset($schema['fields']) && !array_diff($fields, array_keys($schema['fields']));
}


    
{'path': 'public/docs/drupal~7/includes-cache.inc/function/drupaldatabasecache-isvalidbin/7.x.html', 'source': 'DevDocs.IO'}