src/Invoice/FlattenerInvoiceLines.php
protected function correctInfoBetweenParentAndChildren(array &$parent, array &$children)
    {
        if (!empty($children)) {
            $parent[Meta::Parent] = $this->parentIndex;
            $parent[Meta::NumberOfChildren] = count($children);
            foreach ($children as &$child) {
                $child[Tag::Product] = $this->indentDescription($child[Tag::Product]);
                $child[Meta::ParentIndex] = $this->parentIndex;
            }
            $this->parentIndex++;
        }
    }
protected function correctInfoBetweenParentAndChildren(array &$parent, array &$children)
    {
        if (!empty($children)) {
            $parent[Meta::Parent] = $this->parentIndex;
            $parent[Meta::NumberOfChildren] = count($children);
            foreach ($children as &$child) {
                $child[Tag::Product] = $this->indentDescription($child[Tag::Product]);
                $child[Meta::ParentIndex] = $this->parentIndex;
            }
            $this->parentIndex++;
        }
    }
protected function correctInfoBetweenParentAndChildren ( array & $ parent , array & $ children ) { if ( ! empty ( $ children ) ) { $ parent [ Meta :: Parent ] = $ this -> parentIndex ; $ parent [ Meta :: NumberOfChildren ] = count ( $ children ) ; foreach ( $ children as & $ child ) { $ child [ Tag :: Product ] = $ this -> indentDescription ( $ child [ Tag :: Product ] ) ; $ child [ Meta :: ParentIndex ] = $ this -> parentIndex ; } $ this -> parentIndex ++ ; } }
Allows to correct or remove info between or from parent and child lines.

This method is called before the child lines are added to the set of
invoice lines.

This base implementation performs the following actions:
- Add meta data to parent and children to link them to each other.
- Indent product descriptions of the children.

Situations that may have to be covered by web shop specific overrides:
- Price info only on parent.
- Price info only on children.
- Price info both on parent and children and the amounts are doubled.
(price on parent is the sum of the prices of the children).
- Price info both on parent and children but the amounts are not doubled
(base price on parent plus extra/less charges for options on children).

@param array $parent
The parent invoice line.
@param array[] $children
The child invoice lines.
Allows to correct or remove info between or from parent and child lines .