private function cacheSet($alias, $collection, $result)
    {
        if (!$this->cacheEnabled) {
            return null;
        }

        $hash = spl_object_hash($collection);
        if (!isset($this->cache[$hash])) {
            $this->cache[$hash] = []; // initialize the collection's cache
        }
        $this->cache[$hash][$alias] = $result;
    }