protected function cache() {
        $cacheInstance = function($id, &$cache) use (&$cacheInstance) {
            self::selectIds($id, $ids);

            if (empty($ids)) {
                $cache[$id] = $this;
            } else {
                $cacheInstance($ids, $cache[$id]);
            }
        };

        foreach ($this->cacheIds() as $cacheId) {
            $cacheInstance($cacheId, self::$cache);
        }
    }