public function prepareCompositeTitleForPersist($fieldsToConcatenate, $data)
    {
        $composite_title = "";

        // count to determine spacing between fields
        $count = count($fieldsToConcatenate);
        $i = 1;


        foreach ($fieldsToConcatenate as $fieldToConcatenate)
        {
            // If the field is blank, then skip the concatenation.
            // Eg: The field "street2" is blank
            if (($data[$fieldToConcatenate] == "") || (!$data[$fieldToConcatenate]) || (empty($data[$fieldToConcatenate])))
            {
                // blank on purpose --> yeah, I'm leaving it this way 'cause three months from now I'll actually
                //                      understand what I was thinking on the wrong side of midnight on May 27th, 2015!

            } else {

                $composite_title .= $data[$fieldToConcatenate];

                if ($i < $count) $composite_title .= " ";
            }
        }
        return $composite_title;
    }
public function prepareCompositeTitleForPersist($fieldsToConcatenate, $data)
    {
        $composite_title = "";

        // count to determine spacing between fields
        $count = count($fieldsToConcatenate);
        $i = 1;


        foreach ($fieldsToConcatenate as $fieldToConcatenate)
        {
            // If the field is blank, then skip the concatenation.
            // Eg: The field "street2" is blank
            if (($data[$fieldToConcatenate] == "") || (!$data[$fieldToConcatenate]) || (empty($data[$fieldToConcatenate])))
            {
                // blank on purpose --> yeah, I'm leaving it this way 'cause three months from now I'll actually
                //                      understand what I was thinking on the wrong side of midnight on May 27th, 2015!

            } else {

                $composite_title .= $data[$fieldToConcatenate];

                if ($i < $count) $composite_title .= " ";
            }
        }
        return $composite_title;
    }
public function prepareCompositeTitleForPersist ( $ fieldsToConcatenate , $ data ) { $ composite_title = "" ; // count to determine spacing between fields $ count = count ( $ fieldsToConcatenate ) ; $ i = 1 ; foreach ( $ fieldsToConcatenate as $ fieldToConcatenate ) { // If the field is blank, then skip the concatenation. // Eg: The field "street2" is blank if ( ( $ data [ $ fieldToConcatenate ] == "" ) || ( ! $ data [ $ fieldToConcatenate ] ) || ( empty ( $ data [ $ fieldToConcatenate ] ) ) ) { // blank on purpose --> yeah, I'm leaving it this way 'cause three months from now I'll actually //                      understand what I was thinking on the wrong side of midnight on May 27th, 2015! } else { $ composite_title .= $ data [ $ fieldToConcatenate ] ; if ( $ i < $ count ) $ composite_title .= " " ; } } return $ composite_title ; }
Concatenate fields for the composite Title field

@param  array    $fieldsToConcatenate
@param  array    $data
@return string
Concatenate fields for the composite Title field