private function getMetadataDirs()
    {
        if (null === $this->metadataDirs) {
            $this->metadataDirs = array();
            $bundles = $this->kernel->getBundles();
            $fs = new Filesystem();

            /**
             * @var string $bundleName
             * @var BundleInterface $bundle
             */
            foreach ($bundles as $bundleName => $bundle) {
                $directory = $this->kernel->locateResource("@$bundleName/Resources");
                $directory .= '/config/m7_encryption';
                if ($fs->exists($directory)) {
                    $nameSpace = $bundle->getNamespace();
                    $this->metadataDirs[$nameSpace] = $directory;
                }
            }
        }

        return $this->metadataDirs;
    }