/**
  *
  */
 public static function initialize()
 {
     if (!self::$inited) {
         if (!ActiveQueryCacheHelper::scriptExists(self::$shaCache)) {
             $path = __DIR__ . DIRECTORY_SEPARATOR . 'lua' . DIRECTORY_SEPARATOR . 'cache.lua';
             ActiveQueryCacheHelper::loadScript($path);
         }
         if (!ActiveQueryCacheHelper::scriptExists(self::$shaInvalidate)) {
             $path = __DIR__ . DIRECTORY_SEPARATOR . 'lua' . DIRECTORY_SEPARATOR . 'invalidate.lua';
             ActiveQueryCacheHelper::loadScript($path);
         }
         self::$inited = true;
     }
 }
Ejemplo n.º 2
0
 /**
  * @inheritdoc
  */
 public static function deleteAll($condition = '', $params = [])
 {
     ActiveQueryCacheHelper::dropCachesForCondition(static::className(), $condition, $params);
     return parent::deleteAll($condition, $params);
 }