Angejia\Pea\QueryBuilder::flushAffectingRowCache PHP Method

flushAffectingRowCache() private method

查找受影响的 ID,清空相关行级缓存
    private function flushAffectingRowCache()
    {
        $keyName = $this->model->primaryKey();
        $toDeleteRows = parent::get();
        $ids = [];
        foreach ($toDeleteRows as $row) {
            $ids[] = $row->{$keyName};
        }
        if ($ids) {
            $cacheKeys = $this->buildRowCacheKey($ids);
            $cache = $this->getCache();
            $cache->del(array_values($cacheKeys));
        }
    }