Remove unused makeCustomFieldKeyValuePair() method

This commit is contained in:
Benjamin Beganović 2020-12-25 12:25:28 +01:00
parent 85a27941f2
commit 83ec60cf70

View File

@ -74,6 +74,7 @@ trait MakesInvoiceValues
if ($custom_fields && property_exists($custom_fields, $field)) {
$custom_field = $custom_fields->{$field};
$custom_field_parts = explode('|', $custom_field);
return $custom_field_parts[0];
@ -96,35 +97,6 @@ trait MakesInvoiceValues
return '';
}
/**
* This method produces the key /value pairs for
* custom fields.
*
* We need to explode the field name and search for the |
* we split on the pipe, the first value is the field name
* and the second is the field _type_
*
* We transform the $value depending the $field type
*
* @param string $field The full field name
* @param string $value The custom value
* @return array The key value pair
*/
private function makeCustomFieldKeyValuePair($field, $value)
{
if ($this->findCustomType($field) == 'date') {
$value = $this->formatDate($value, $this->client->date_format());
} elseif ($this->findCustomType($field) == 'switch') {
$value = ctrans('texts.'.$value);
}
if (! $value) {
$value = '';
}
return ['value' => $value, 'field' => $this->makeCustomField($field)];
}
public function makeLabels($contact = null) :array
{
$data = [];