Example #1
0
 public function success(Form $form)
 {
     $values = $form->getValues();
     if ($values['section'] === 'all') {
         $this->cacheStorage->clean(array(Cache::ALL => true));
         $this->session->destroy();
     } elseif ($values['section'] === 'cache') {
         $this->cacheStorage->clean(array(array(Cache::ALL => true)));
     } elseif ($values['section'] === 'sessions') {
         $this->session->destroy();
     }
 }
Example #2
0
File: Model.php Project: ytnuk/orm
 public function __construct(array $configuration, Nextras\Orm\Model\IRepositoryLoader $repositoryLoader, Nextras\Orm\Model\MetadataStorage $metadataStorage, Nette\Caching\IStorage $cacheStorage)
 {
     parent::__construct($configuration, $repositoryLoader, $metadataStorage);
     $this->onFlush[] = function () use($cacheStorage) {
         $cacheStorage->clean([Nette\Caching\Cache::TAGS => $this->tags]);
         $this->tags = [];
     };
 }
Example #3
0
 /**
  * Removes items from the cache by conditions.
  * Conditions are:
  * - Cache::PRIORITY => (int) priority
  * - Cache::TAGS => (array) tags
  * - Cache::ALL => TRUE
  * @return void
  */
 public function clean(array $conditions = NULL)
 {
     $conditions = (array) $conditions;
     if (isset($conditions[self::TAGS])) {
         $conditions[self::TAGS] = array_values((array) $conditions[self::TAGS]);
     }
     $this->storage->clean($conditions);
 }
Example #4
0
 /**
  * Removes items from the cache by conditions.
  * Conditions are:
  * - Cache::PRIORITY => (int) priority
  * - Cache::TAGS => (array) tags
  * - Cache::ALL => TRUE
  * @return void
  */
 public function clean(array $conditions = NULL)
 {
     $this->release();
     $this->storage->clean((array) $conditions);
 }
Example #5
0
 /**
  * Removes items from the cache by conditions.
  * Conditions are:
  * - Cache::PRIORITY => (int) priority
  * - Cache::TAGS => (array) tags
  * - Cache::ALL => TRUE
  * @return void
  */
 public function clean(array $conditions = NULL)
 {
     $this->key = $this->data = NULL;
     $this->storage->clean((array) $conditions);
 }
Example #6
0
 /**
  * Removes items from the cache by conditions.
  * Conditions are:
  * - Cache::PRIORITY => (int) priority
  * - Cache::TAGS => (array) tags
  * - Cache::ALL => TRUE
  *
  * @param  array
  *
  * @return void
  */
 public function clean(array $conds = null)
 {
     $this->release();
     $this->storage->clean((array) $conds);
 }