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;

    }
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;

    }
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 ; }
get the assigned template of the given TemplatableNodeInterface
handles the template selection if no template is assigned

@param TemplatableNodeInterface $node
@return mixed|string
get the assigned template of the given TemplatableNodeInterface handles the template selection if no template is assigned