public function getTemplate(TemplatableNodeInterface $node)
    {

        $template = $node->getTemplate();

        if (!$template) {

            $meta = $this->manager->getClassMetadata(get_class($node));

            if (!empty($this->templates[$meta->name]) && count($this->templates[$meta->name]) > 0)
                $template = reset($this->templates[$meta->name]);

            else {
                $name = trim(str_replace($meta->namespace, '', $meta->name), '\\');
                $bundleName = $this->getBundleNameFromEntity($meta->namespace, $this->container->get('kernel')->getBundles());
                $template = $this->getDefaultTemplate($name, $bundleName);
            }
        }

        return $template;

    }