public function calculateFieldsInfo(array $data)
    {
        if (! $this->exists) {
            return null;
        }

        $output = array();

        foreach ($this->_fields as $key => $field) {
            if ($field instanceof FieldInterface) {
                if ($field->toTrackInfo()) {
                    $inVal  = isset($data[$key]) ? $data[$key] : null;
                    $outVal = $field->calculateFieldInfo($inVal, $data);

                    if ($outVal && $field->isLabelInTrackInfo()) {
                        $label = $field->getLabel();
                        if ($label) {
                            $output[] = $label;
                        }
                    }

                    if (is_array($outVal)) {
                        $output = array_merge($output, array_filter($outVal));
                    } elseif ($outVal || ($outVal == 0)) {
                        $output[] = $outVal;
                    }
                }
            }
        }

        return substr(trim(implode(' ', $output)), 0, $this->maxTrackInfoChars);
    }
public function calculateFieldsInfo(array $data)
    {
        if (! $this->exists) {
            return null;
        }

        $output = array();

        foreach ($this->_fields as $key => $field) {
            if ($field instanceof FieldInterface) {
                if ($field->toTrackInfo()) {
                    $inVal  = isset($data[$key]) ? $data[$key] : null;
                    $outVal = $field->calculateFieldInfo($inVal, $data);

                    if ($outVal && $field->isLabelInTrackInfo()) {
                        $label = $field->getLabel();
                        if ($label) {
                            $output[] = $label;
                        }
                    }

                    if (is_array($outVal)) {
                        $output = array_merge($output, array_filter($outVal));
                    } elseif ($outVal || ($outVal == 0)) {
                        $output[] = $outVal;
                    }
                }
            }
        }

        return substr(trim(implode(' ', $output)), 0, $this->maxTrackInfoChars);
    }
public function calculateFieldsInfo ( array $ data ) { if ( ! $ this -> exists ) { return null ; } $ output = array ( ) ; foreach ( $ this -> _fields as $ key => $ field ) { if ( $ field instanceof FieldInterface ) { if ( $ field -> toTrackInfo ( ) ) { $ inVal = isset ( $ data [ $ key ] ) ? $ data [ $ key ] : null ; $ outVal = $ field -> calculateFieldInfo ( $ inVal , $ data ) ; if ( $ outVal && $ field -> isLabelInTrackInfo ( ) ) { $ label = $ field -> getLabel ( ) ; if ( $ label ) { $ output [ ] = $ label ; } } if ( is_array ( $ outVal ) ) { $ output = array_merge ( $ output , array_filter ( $ outVal ) ) ; } elseif ( $ outVal || ( $ outVal == 0 ) ) { $ output [ ] = $ outVal ; } } } } return substr ( trim ( implode ( ' ' , $ output ) ) , 0 , $ this -> maxTrackInfoChars ) ; }
Calculate the content for the track info field using the other fields

@param array $data The field values
@return string The description to save as track_info
Calculate the content for the track info field using the other fields