Creates a list of nodes with children.

@param \Aimeos\MShop\Catalog\Item\Iface $node Catalog node
171666
protected function createNodeArray( \Aimeos\MShop\Catalog\Item\Iface $node )
	{
		$result = $node->toArray( true );

		foreach( $node->getChildren() as $child ) {
			$result['children'][] = $this->createNodeArray( $child );
		}

		return (object) $result;
	}
130489
public function addChild(Node $node, $key = null)
    {
        if ($key === null) {
            $this->children[] = $node;
        } else {
            $this->children[ $key ] = $node;
        }

        return $node;
    }
841462
public function add_children(& $node, $parentidnumber) {
        foreach ($this->flat as $competency) {
            if ($competency->parentidnumber == $parentidnumber) {
                $this->progress->increment_progress();
                $node->children[] = $competency;
                $this->add_children($competency, $competency->idnumber);
            }
        }
    }
782195
private function buildChildNode($node, $references, $maxLevel)
    {
        if (isset($references[$node->getParentId()])) {
            $level = $references[$node->getParentId()]->getLevel() + 1;

            // Check if max level is not reached or not set at all.
            if ($maxLevel == 0 || $level <= $maxLevel) {
                $node->setLevel($level);
                $node->setParent($references[$node->getParentId()]);
                $references[$node->getParentId()]->setChild($node, $node->getId());
            }
        }
    }
1267682
protected function fromArray( \Aimeos\MShop\Product\Item\Iface $item, array $data )
	{
		$listManager = \Aimeos\MShop::create( $this->getContext(), 'product/lists' );

		$listItem = $listManager->createItem()->setType( 'bought-together' );
		$listItems = $item->getListItems( 'product', 'bought-together', null, false );

		foreach( $this->getValue( $data, 'product.lists.id', [] ) as $idx => $id )
		{
			if( isset( $listItems[$id] ) ) {
				$litem = $listItems[$id]; unset( $listItems[$id] );
			} else {
				$litem = clone $listItem;
			}

			$litem->setId( $id );
			$litem->setPosition( $idx );
			$litem->setRefId( $this->getValue( $data, 'product.lists.refid/' . $idx ) );

			$item->addListItem( 'product', $litem, $litem->getRefItem() );
		}

		return $item->deleteListItems( $listItems );
	}
1325179
public function process( \Aimeos\MShop\Coupon\Item\Code\Iface $item, array $data )
	{
		return $data;
	}
1149960
public function childrenOf(Node $node, array $columns=[])
    {
        $columns = $this->pickColumns($columns);
        $columnsId = $this->getColumnsCacheId($columns);
    }
125835
public function addChild(RouteTreeNode $node)
    {
        $hash = $node->getFirstMatcher()->getHash();

        $this->children[$hash] = $node;
    }
878573
protected function fromArray( \Aimeos\MShop\Customer\Item\Iface $item, array $data )
	{
		$context = $this->getContext();
		$listIds = $this->getValue( $data, 'customer.lists.id', [] );

		$listManager = \Aimeos\MShop::create( $context, 'customer/lists' );

		$search = $listManager->createSearch()->setSlice( 0, count( $listIds ) );
		$search->setConditions( $search->compare( '==', 'customer.lists.id', $listIds ) );

		$listItems = $listManager->searchItems( $search );


		foreach( (array) $listIds as $idx => $listid )
		{
			if( isset( $listItems[$listid] ) ) {
				$litem = $listItems[$listid];
			} else {
				$litem = $listManager->createItem();
			}

			$litem->setParentId( $item->getId() );
			$litem->setDomain( 'product' );

			if( isset( $data['customer.lists.refid'][$idx] ) ) {
				$litem->setRefId( $this->getValue( $data, 'customer.lists.refid/' . $idx ) );
			}

			if( isset( $data['customer.lists.status'][$idx] ) ) {
				$litem->setStatus( $this->getValue( $data, 'customer.lists.status/' . $idx ) );
			}

			if( isset( $data['customer.lists.type'][$idx] ) ) {
				$litem->setType( $this->getValue( $data, 'customer.lists.type/' . $idx ) );
			}

			if( isset( $data['customer.lists.position'][$idx] ) ) {
				$litem->setPosition( $this->getValue( $data, 'customer.lists.position/' . $idx ) );
			}

			if( isset( $data['customer.lists.datestart'][$idx] ) ) {
				$litem->setDateStart( $this->getValue( $data, 'customer.lists.datestart/' . $idx ) );
			}

			if( isset( $data['customer.lists.dateend'][$idx] ) ) {
				$litem->setDateEnd( $this->getValue( $data, 'customer.lists.dateend/' . $idx ) );
			}

			if( isset( $data['customer.lists.config'][$idx] )
				&& ( $conf = json_decode( $this->getValue( $data, 'customer.lists.config/' . $idx ), true ) ) !== null
			) {
				$litem->setConfig( $conf );
			}

			if( $litem->getId() === null && isset( $data['config'][$idx]['key'] ) )
			{
				$conf = [];

				foreach( (array) $data['config'][$idx]['key'] as $pos => $key )
				{
					if( trim( $key ) !== '' && isset( $data['config'][$idx]['val'][$pos] ) ) {
						$conf[$key] = $data['config'][$idx]['val'][$pos];
					}
				}

				$litem->setConfig( $conf );
			}

			$listManager->saveItem( $litem, false );
		}
	}
762654
protected function link_nodes(&$node, $is_child)
	{
		$node->parent = $this->parent;
		$this->parent->nodes[] = $node;
		if ($is_child)
		{
			$this->parent->children[] = $node;
		}
	}
562537
protected function addGroups( \Aimeos\MShop\Context\Item\Iface $context )
	{
		if( ( $userid = Auth::id() ) !== null )
		{
			$context->setGroupIds( function() use ( $context, $userid )
			{
				$manager = \Aimeos\MShop::create( $context, 'customer' );
				return $manager->getItem( $userid, array( 'customer/group' ) )->getGroups();
			} );
		}

		return $context;
	}
1237203
private function deleteChildren( $node ) {
		while ( isset( $node->firstChild ) ) {
			$this->deleteChildren( $node->firstChild );
			$node->removeChild( $node->firstChild );
		}
	}
979662
private function getChildren(NodeInterface $node)
    {
        $result = [];
        foreach ($node->getNodes() as $child) {
            $result[$child->getIdentifier()] = $child;
        }

        return $result;
    }
317900
protected function pushChildNode(Element $node)
    {
        $node->attributes->addAttributeClass('list-group-item');

        if ($node instanceof Lists\Item) {
            $node->setContextualClassPrefix('list-group-item');
        }

        parent::pushChildNode($node);
    }
345687
static function createFromNode( $node )
    {
        $row = array( 'node_id' => $node->attribute( 'node_id' ),
                      'parent_node_id' => $node->attribute( 'parent_node_id' ),
                      'main_node_id' => $node->attribute( 'main_node_id' ),
                      'contentobject_id' => $node->attribute( 'contentobject_id' ),
                      'contentobject_version' => $node->attribute( 'contentobject_version' ),
                      'contentobject_is_published' => $node->attribute( 'contentobject_is_published' ),
                      'depth' => $node->attribute( 'depth' ),
                      'sort_field' => $node->attribute( 'sort_field' ),
                      'sort_order' => $node->attribute( 'sort_order' ),
                      'priority' => $node->attribute( 'priority' ),
                      'modified_subnode' => $node->attribute( 'modified_subnode' ),
                      'path_string' => $node->attribute( 'path_string' ),
                      'path_identification_string' => $node->attribute( 'path_identification_string' ),
                      'remote_id' => $node->attribute( 'remote_id' ),
                      'is_hidden' => $node->attribute( 'is_hidden' ),
                      'is_invisible' => $node->attribute( 'is_invisible' ),
                      'trashed' => time() );

        $trashNode = new eZContentObjectTrashNode( $row );
        return $trashNode;
    }
848302
public function addNode(&$node)
    {
        //Nodes must be an instance graph Node;
        if (!$this->isNode($node)) {
            throw new \Exception("Node must be an instance of Graph\Node", PLATFORM_ERROR);
        }
        $nodedId = $node->getId();
        if (!empty($nodedId) && !isset($this->nodeSet[$node->getId()])) {
            $this->nodeSet[$node->getId()] = &$node;
        }
        return $this;
    }
422852
protected function getChildren(ReadNodeInterface $node, $list)
    {
        $children = array();

        if (!empty($list[$node->getNodeId()]) && is_array($list[$node->getNodeId()])) {
            foreach ($list[$node->getNodeId()] as $child) {
                $position = $this->getNodePosition($child, $children);
                $children[$position] = $this->createTree($child, $list);
            }
        }

        $children = $this->sortArray($children);

        return $children;
    }