App\Models\Traits\PresentsInvoice::applyLabels PHP Method

applyLabels() private method

private applyLabels ( $fields )
    private function applyLabels($fields)
    {
        $labels = $this->getInvoiceLabels();
        foreach ($fields as $section => $sectionFields) {
            foreach ($sectionFields as $index => $field) {
                list($entityType, $fieldName) = explode('.', $field);
                if (substr($fieldName, 0, 6) == 'custom') {
                    $fields[$section][$field] = $labels[$field];
                } else {
                    $fields[$section][$field] = $labels[$fieldName];
                }
                unset($fields[$section][$index]);
            }
        }
        return $fields;
    }