private function clearCacheForBuiltInType($type)
    {
        if (!$this->getContainer()->hasParameter(sprintf('cache.%s', $type))) {
            return true;
        }

        $config = $this->getContainer()->getParameter(sprintf('cache.%s', $type));

        if ($type === 'doctrine') {
            $result = true;
            $result = $result && $this->clearTypedCacheFromService($type, $config['metadata']['service_id']);
            $result = $result && $this->clearTypedCacheFromService($type, $config['result']['service_id']);
            $result = $result && $this->clearTypedCacheFromService($type, $config['query']['service_id']);

            return $result;
        } else {
            return $this->clearTypedCacheFromService($type, $config['service_id']);
        }
    }