Returns a template for the parent of this template.

@throws ValidationException if the template has no parent.
779909
public PathTemplate parentTemplate() {
    int i = segments.size();
    Segment seg = segments.get(--i);
    if (seg.kind() == SegmentKind.END_BINDING) {
      while (i > 0 && segments.get(--i).kind() != SegmentKind.BINDING) {}
    }
    if (i == 0) {
      throw new ValidationException("template does not have a parent");
    }
    return new PathTemplate(segments.subList(0, i), urlEncoding);
  }
1320913
def get_parent(self):
        """"""

        parent_iter = self.model.iter_parent(self.iter)
        if parent_iter:
            return TreeModelRow(self.model, parent_iter)
1288598
protected function determineParentObj()
    {
        $parent = $this->parentIdentifier;
        $parentPage = SiteTree::get()->byID((int) $parent);
        if (!$parentPage) {
            $parentPage = SiteTree::get_by_link($parent);
        }
        if (!$parentPage) {
            $parentPage = SiteTree::get()->filter(array('Title' => trim($parent)))->first();
        }
        if (!$parentPage) {
            throw new Exception("Could not find a page with ID, URLSegment, or Title \"$parent\"");
        }
        if (!Injector::inst()->get($this->subjectClass)->hasField($this->parentField)) {
            throw new Exception("{$this->subjectClass} has no field {$this->parentField}.");
        }

        $this->parentObj = $parentPage;
        $this->log("Parent page is #{$parentPage->ID} {$parentPage->getTitle()}");
    }
1103483
public function getMethodTemplate()
    {
        if (!isset($this->methodTemplate)) {
            $this->methodTemplate = $this->_getMethodTemplate();
        }

        return $this->methodTemplate;
    }
1170287
public ElemTemplate getOwnerXSLTemplate()
  {
  	ElemTemplateElement el = this;
  	int type = el.getXSLToken();
  	while((null != el) && (type != Constants.ELEMNAME_TEMPLATE))
  	{
    	el = el.getParentElem();
    	if(null != el)
  			type = el.getXSLToken();
  	}
  	return (ElemTemplate)el;
  }
764404
public function getRootForm()
    {
        $rootRenderable = $this->parentRenderable;
        while ($rootRenderable !== null && !($rootRenderable instanceof FormDefinition)) {
            $rootRenderable = $rootRenderable->getParentRenderable();
        }
        if ($rootRenderable === null) {
            throw new FormDefinitionConsistencyException(sprintf('The form element "%s" is not attached to a parent form.', $this->identifier), 1326803398);
        }

        return $rootRenderable;
    }
353865
public ValidationData findListParent() {
        if (!this.listChild) {
            return null;
        }

        ValidationData parent = this.parent;
        while (parent != null && !parent.isList()) {
            parent = parent.parent;
        }
        return parent;
    }
109147
def parent(self):
        
        if not self._meta.parent:
            return None

        if not self.__parent__:
            self.__parent__ = self._meta.parent()

        return self.__parent__
939033
public function getToolbarTemplate()
    {
        if (null === $this->templateToolbar) {
            $this->templateToolbar = $this->getTemplatePathDefault('toolbar');
        }

        return $this->templateToolbar;
    }
964417
public function getParent(array $context)
    {
        if (null !== $this->parent) {
            return $this->parent;
        }

        $parent = $this->doGetParent($context);
        if (false === $parent) {
            return false;
        } elseif ($parent instanceof Twig_Template) {
            $name = $parent->getTemplateName();
            $this->parents[$name] = $parent;
            $parent = $name;
        } elseif (!isset($this->parents[$parent])) {
            $this->parents[$parent] = $this->env->loadTemplate($parent);
        }

        return $this->parents[$parent];
    }
11564
public function getParentNode()
    {
        if (!$this->parentNode) {
            throw new \RuntimeException(sprintf(
                'Trying to retrieve parent node when no parent node has been set. An event ' .
                'listener should have set the node when persisting document "%s"',
                DocumentHelper::getDebugTitle($this->document)
            ));
        }

        return $this->parentNode;
    }
799550
function(parent) {
    function error(usage) {
      return new Error('Template theme fields are not permitted '+ usage +':\n>>> '+ Node.toString(parent));
    }

    // Check for arguments implementation:
    if (parent.type === NodeType.ARGUMENTS) {
      throw error('as arguments');
    }

    // Check for interpolations implementation:
    if (parent.type === NodeType.INTERPOLATION) {
      throw error('in interpolations');
    }

    // Check for operations implementation:
    for (var i=0; i < parent.content.length; i++) {
      if (NodeType.OPERATOR.test(parent.content[i].type)) {
        throw error('in operations');
      }
    }
  }
115138
public function getParentAttribute()
    {
        $parentClass = $this->block->parent_type;
        return $parentClass::find($this->block->parent_id);
    }
37919
public function getTemplates()
    {
        $template = parent::getTemplates();

        if ($default = $this->defaultTemplate) {
            $key = array_search('FormField', $template);

            if ($key !== false) {
                $default[$key] = $this->defaultTemplate;
            }
        }

        return $template;
    }
255884
public ResourceName parentName() {
    PathTemplate parentTemplate = template.parentTemplate();
    return new ResourceName(parentTemplate, values, endpoint);
  }
1280371
public static function parent()
    {
        if (!self::$activeTraitMethod) {
            throw new \BadMethodCallException("next:parent() call is only allowed in trait calls");
        }
        $arguments = func_get_args();

        return call_user_func(self::$activeTraitMethod, $arguments);
    }
1083532
public TemplateBean getTemplate() {

        TemplateBean templateBean = getRequestAttribute(CmsTemplateContextManager.ATTR_TEMPLATE_BEAN);
        if (templateBean == null) {
            templateBean = new TemplateBean("", "");
        }
        return templateBean;
    }