Exemplo n.º 1
0
 /**
  * Deletes tag bindings on model delete.
  * @param CModelEvent $event
  * @return void
  */
 public function afterDelete($event)
 {
     // delete all present tag bindings
     $this->deleteTags();
     $this->cache->delete($this->getCacheKey());
     $this->resetAllTagsWithModelsCountCache();
     parent::afterDelete($event);
 }
Exemplo n.º 2
0
 /**
  * Release acquired mutex.
  * 
  * @param  string $name
  * @return bool
  */
 public function release($name)
 {
     if (!isset($this->acqiured[$name])) {
         return false;
     }
     $lockName = $this->getLockName($name);
     $this->cache->delete($lockName);
     unset($this->acqiured[$name]);
     return true;
 }