DatabaseBackend::register

public DatabaseBackend::register($name, $window = 3600, $identifier = NULL) Registers an event for the current visitor to the flood control mechanism. Parameters string $name: The name of an event. To prevent unintended name clashes, it is recommended to use the module name first in the event name, optionally followed by a dot and the actual event name (e.g. "mymodule.my_event"). int $window: (optional) Number of seconds before this event expires. Defaults to 3600 (1 hour). Typically uses the

DatabaseBackend::prepareItem

protected DatabaseBackend::prepareItem($cache, $allow_invalid) Prepares a cached item. Checks that items are either permanent or did not expire, and unserializes data as appropriate. Parameters object $cache: An item loaded from cache_get() or cache_get_multiple(). bool $allow_invalid: If FALSE, the method returns FALSE if the cache item is not valid. Return value mixed|false The item with data unserialized as appropriate and a property indicating whether the item is valid, or FALSE if there

DatabaseBackend::normalizeCid

protected DatabaseBackend::normalizeCid($cid) Normalizes a cache ID in order to comply with database limitations. Parameters string $cid: The passed in cache ID. Return value string An ASCII-encoded cache ID that is at most 255 characters long. File core/lib/Drupal/Core/Cache/DatabaseBackend.php, line 403 Class DatabaseBackend Defines a default cache implementation. Namespace Drupal\Core\Cache Code protected function normalizeCid($cid) { // Nothing to do if the ID is a US ASCII str

DatabaseBackend::isAllowed

public DatabaseBackend::isAllowed($name, $threshold, $window = 3600, $identifier = NULL) Checks whether a user is allowed to proceed with the specified event. Events can have thresholds saying that each user can only do that event a certain number of times in a time window. This function verifies that the current user has not exceeded this threshold. Parameters string $name: The name of an event. int $threshold: The maximum number of times each user can do this event per time window. int $wind

DatabaseBackend::invalidateMultiple

public DatabaseBackend::invalidateMultiple(array $cids) Marks cache items as invalid. Invalid items may be returned in later calls to get(), if the $allow_invalid argument is TRUE. Parameters string[] $cids: An array of cache IDs to invalidate. Overrides CacheBackendInterface::invalidateMultiple See also \Drupal\Core\Cache\CacheBackendInterface::deleteMultiple() \Drupal\Core\Cache\CacheBackendInterface::invalidate() \Drupal\Core\Cache\CacheBackendInterface::invalidateAll() File core/lib/Drupa

DatabaseBackend::invalidateAll

public DatabaseBackend::invalidateAll() Marks all cache items as invalid. Invalid items may be returned in later calls to get(), if the $allow_invalid argument is TRUE. Overrides CacheBackendInterface::invalidateAll See also \Drupal\Core\Cache\CacheBackendInterface::deleteAll() \Drupal\Core\Cache\CacheBackendInterface::invalidate() \Drupal\Core\Cache\CacheBackendInterface::invalidateMultiple() File core/lib/Drupal/Core/Cache/DatabaseBackend.php, line 313 Class DatabaseBackend Defines a de

DatabaseBackend::invalidate

public DatabaseBackend::invalidate($cid) Marks a cache item as invalid. Invalid items may be returned in later calls to get(), if the $allow_invalid argument is TRUE. Parameters string $cid: The cache ID to invalidate. Overrides CacheBackendInterface::invalidate See also \Drupal\Core\Cache\CacheBackendInterface::delete() \Drupal\Core\Cache\CacheBackendInterface::invalidateMultiple() \Drupal\Core\Cache\CacheBackendInterface::invalidateAll() File core/lib/Drupal/Core/Cache/DatabaseBackend.php,

DatabaseBackend::getMultiple

public DatabaseBackend::getMultiple(&$cids, $allow_invalid = FALSE) Returns data from the persistent cache when given an array of cache IDs. Parameters array $cids: An array of cache IDs for the data to retrieve. This is passed by reference, and will have the IDs successfully returned from cache removed. bool $allow_invalid: (optional) If TRUE, cache items may be returned even if they have expired or been invalidated. Such items may sometimes be preferred, if the alternative is recalculati

DatabaseBackend::get

public DatabaseBackend::get($cid, $allow_invalid = FALSE) Returns data from the persistent cache. Parameters string $cid: The cache ID of the data to retrieve. bool $allow_invalid: (optional) If TRUE, a cache item may be returned even if it is expired or has been invalidated. Such items may sometimes be preferred, if the alternative is recalculating the value stored in the cache, especially if another concurrent request is already recalculating the same value. The "valid" property of the retur

DatabaseBackend::garbageCollection

public DatabaseBackend::garbageCollection() Cleans up expired flood events. This method is called automatically on cron run. Overrides FloodInterface::garbageCollection See also system_cron() File core/lib/Drupal/Core/Flood/DatabaseBackend.php, line 136 Class DatabaseBackend Defines the database flood backend. This is the default Drupal backend. Namespace Drupal\Core\Flood Code public function garbageCollection() { try { $return = $this->connection->delete(static::TABLE_NA