You are here

public function CacheFragmentController::wipe in RESTful 7.2

Removes all the cache fragments.

File

src/RenderCache/Entity/CacheFragmentController.php, line 128
Contains \Drupal\restful\RenderCache\Entity\CacheFragmentController.

Class

CacheFragmentController
Class CacheFragmentController.

Namespace

Drupal\restful\RenderCache\Entity

Code

public function wipe() {

  // We are not truncating the entity table so hooks are fired.
  $query = new \EntityFieldQuery();
  $results = $query
    ->entityCondition('entity_type', static::ENTITY_TYPE)
    ->execute();
  if (empty($results[static::ENTITY_TYPE])) {
    return;
  }
  if ($this
    ->isFastDeleteEnabled()) {
    db_truncate($this::getTableName())
      ->execute();
    return;
  }
  $this
    ->delete(array_keys($results[static::ENTITY_TYPE]));
}