public function generatePartnerName(PersonalDetails $personalDetails)
    {
        $parts = array();
        foreach (array('initials', 'prefix', 'lastname') as $part) {
            if ('' !== ($value = (string)$personalDetails->{'get'.ucfirst($part)}()))
                $parts[] = $value;
        }

        return join(' ', $parts);
    }
public function generatePartnerName(PersonalDetails $personalDetails)
    {
        $parts = array();
        foreach (array('initials', 'prefix', 'lastname') as $part) {
            if ('' !== ($value = (string)$personalDetails->{'get'.ucfirst($part)}()))
                $parts[] = $value;
        }

        return join(' ', $parts);
    }
public function generatePartnerName ( PersonalDetails $ personalDetails ) { $ parts = array ( ) ; foreach ( array ( 'initials' , 'prefix' , 'lastname' ) as $ part ) { if ( '' !== ( $ value = ( string ) $ personalDetails -> { 'get' . ucfirst ( $ part ) } ( ) ) ) $ parts [ ] = $ value ; } return join ( ' ' , $ parts ) ; }
Generates and returns the name of the partner
@return string
Generates and returns the name of the partner