Create layout blocks hierarchy from layout xml configuration

@param Mage_Core_Model_Layout_Element|null $parent
500659
public function generateBlocks($parent = null)
    {
        if ($parent instanceof Mage_Core_Model_Layout_Element) {
            // This prevents processing child blocks if the parent block fails a conditional check
            if (!$this->checkConditionals($parent)) {
                return;
            }

            // This is handled here so it catches 'block' and 'reference' elements
            $this->processOutputAttribute($parent);
        }

        parent::generateBlocks($parent);
    }
192394
public function setParent($parent_id = null): self
    {
        $parent_id = ((int) $parent_id > 0) ? (int) $parent_id : null;

        $this->setAttribute('parent_id', $parent_id);

        return $this;
    }
1291355
protected function toXML(DOMElement $parent) : DOMElement
    {
        $e = $parent->ownerDocument->createElementNS(Constants::NS_MD, $this->elementName);
        $parent->appendChild($e);

        if ($this->ID !== null) {
            $e->setAttribute('ID', $this->ID);
        }

        if ($this->validUntil !== null) {
            $e->setAttribute('validUntil', gmdate('Y-m-d\TH:i:s\Z', $this->validUntil));
        }

        if ($this->cacheDuration !== null) {
            $e->setAttribute('cacheDuration', $this->cacheDuration);
        }

        $e->setAttribute('protocolSupportEnumeration', implode(' ', $this->protocolSupportEnumeration));

        if ($this->errorURL !== null) {
            $e->setAttribute('errorURL', $this->errorURL);
        }

        Extensions::addList($e, $this->Extensions);

        foreach ($this->KeyDescriptor as $kd) {
            $kd->toXML($e);
        }

        if ($this->Organization !== null) {
            $this->Organization->toXML($e);
        }

        foreach ($this->ContactPerson as $cp) {
            $cp->toXML($e);
        }

        return $e;
    }
571397
@SuppressWarnings("unchecked")
  public void setParent(PvmExecutionImpl parent) {
    PvmExecutionImpl currentParent = getParent();

    setParentExecution(parent);

    if (currentParent != null) {
      currentParent.getExecutions().remove(this);
    }

    if (parent != null) {
      ((List<PvmExecutionImpl>) parent.getExecutions()).add(this);
    }
  }
431182
public function parent($parent = null)
    {
        if ($parent === null) {
            return $this->_parent;
        }
        $this->_parent = $parent;

        return $this;
    }
936394
public Element createDOMNode(Element parent) {
        Element domNode = parent.getOwnerDocument().createElement(tagName);
        LayoutUtil.copyAttributes(attributes, domNode);
        parent.appendChild(domNode);
        return domNode;
    }
1276009
private function parameterList(ParentNode $parent) {
    $node = new CommaListNode();
    $this->mustMatch('(', $parent, 'openParen');
    $parent->addChild($node, 'parameters');
    if ($this->tryMatch(')', $parent, 'closeParen', TRUE)) {
      return;
    }
    do {
      $node->addChild($this->parameter());
    } while ($this->tryMatch(',', $node));
    $this->mustMatch(')', $parent, 'closeParen', TRUE);
  }
576418
public void init(Object parent, Object objURL)
    {
        super.init(parent, objURL);

        this.setLayout(new BorderLayout());

        String strURL = this.getBaseApplet().getProperty(Params.URL);
        if (strURL != null)
            if (strURL.indexOf(':') != -1)
                strURL = strURL.substring(strURL.indexOf(':') + 1);
        this.displayURL(strURL);
    }
573736
public function createElement(Node $parent, $name)
    {
        switch ($name) {
            case 'app:collection':
                return new Collection($parent);
            case 'app:workspace':
                return new Workspace($parent);
        }

        return null;
    }
1137584
public function toXML(DOMElement $parent) : DOMElement
    {
        $doc = $parent->ownerDocument;

        $e = $doc->createElementNS(Common::NS, 'mdui:Logo');
        $e->appendChild($doc->createTextNode($this->url));
        $e->setAttribute('width', strval($this->width));
        $e->setAttribute('height', strval($this->height));
        if ($this->lang !== null) {
            $e->setAttribute('xml:lang', $this->lang);
        }
        $parent->appendChild($e);

        return $e;
    }
1153642
private function insureParentIsSection(Page $parent)
    {
        if (!$parent->hasMainSection()) {
            $this->em->getRepository('BackBee\NestedNode\Page')->saveWithSection($parent);
            $this->em->flush($parent);
        }

        return $parent;
    }
420317
public function setNullParent()
    {
        if ($this->hasParent()) {
            unset($this->parent->children);
        }
        unset($this->parent);
        $this->setParentId(static::$nullParent);
    }
159351
public function set_parent(Node_Container $parent=null)
	{
		$this->parent = $parent;

		if($parent instanceof Node_Container_Document)
			$this->root = $parent;
		else
			$this->root = $parent->root();
	}
1344381
protected function _generateAction($node, $parent)
    {
        if ($node instanceof Mage_Core_Model_Layout_Element) {
            if (!$this->checkConditionals($node)) {
                return $this;
            }
        }

        $method = (string)$node['method'];
        if (!empty($node['block'])) {
            $parentName = (string)$node['block'];
        } else {
            $parentName = $parent->getBlockName();
        }

        $_profilerKey = 'BLOCK ACTION: ' . $parentName . ' -> ' . $method;
        Varien_Profiler::start($_profilerKey);

        if (!empty($parentName)) {
            $block = $this->getBlock($parentName);
        }
        if (!empty($block)) {
            $args = (array)$node->children();

            $jsonArgs = (isset($node['json']) ? explode(' ', (string)$node['json']) : []);
            $jsonHelper = Mage::helper('core');
            $translateArgs = (isset($node['translate']) ? explode(' ', (string)$node['translate']) : []);
            $translateHelper = Mage::helper(isset($node['module']) ? (string)$node['module'] : 'core');
            $args = $this->processActionArgs($args, $jsonArgs, $jsonHelper, $translateArgs, $translateHelper);

            call_user_func_array([$block, $method], $args);
        }

        Varien_Profiler::stop($_profilerKey);

        return $this;
    }
1335309
public function setParent(self $parent = null)
    {
        $this->parent = $parent;
        if ($parent && !($this instanceof VirtualBusinessPage)) {
            $parent->addChild($this);
        }
    }
485714
public function toXML(DOMElement $parent = null) : DOMElement
    {
        if ($parent === null) {
            $doc = DOMDocumentFactory::create();
            $e = $doc->createElementNS(Constants::NS_MD, 'md:EntitiesDescriptor');
            $doc->appendChild($e);
        } else {
            $e = $parent->ownerDocument->createElementNS(Constants::NS_MD, 'md:EntitiesDescriptor');
            $parent->appendChild($e);
        }

        if ($this->ID !== null) {
            $e->setAttribute('ID', $this->ID);
        }

        if ($this->validUntil !== null) {
            $e->setAttribute('validUntil', gmdate('Y-m-d\TH:i:s\Z', $this->validUntil));
        }

        if ($this->cacheDuration !== null) {
            $e->setAttribute('cacheDuration', $this->cacheDuration);
        }

        if ($this->Name !== null) {
            $e->setAttribute('Name', $this->Name);
        }

        Extensions::addList($e, $this->Extensions);

        /** @var \SAML2\XML\md\EntityDescriptor|\SAML2\XML\md\EntitiesDescriptor $node */
        foreach ($this->children as $node) {
            $node->toXML($e);
        }

        $this->signElement($e, $e->firstChild);

        return $e;
    }
670402
protected function createPage($name, $hierarchy, Page $parent = null): Page
    {
        $page = new Page();
        $page->setParent($parent);
        $page->setHierarchy($hierarchy);
        $page->setPublish(1);
        $page->setRedirectType(0);
        $page->setSection('');
        $page->addShop($this->shop);
        foreach ($this->getLocales() as $locale) {
            /** @var PageTranslation $translation */
            $translation = $page->translate($locale->getCode());
            $translation->setName($name);
            $translation->setSlug(Helper::urlize($name));
            $translation->setContent($this->defaultText);
        }
        
        $page->mergeNewTranslations();
        
        $this->manager->persist($page);
        
        return $page;
    }