protected function convertParameters40(Property $newProperty, array $parameters)
    {
        // Adding all parameters.
        foreach ($parameters as $param) {
            // vCard 2.1 allowed parameters with no name
            if ($param->noName) {
                $param->noName = false;
            }

            switch ($param->name) {
                // We need to see if there's any TYPE=PREF, because in vCard 4
                // that's now PREF=1.
                case 'TYPE':
                    foreach ($param->getParts() as $paramPart) {
                        if ('PREF' === strtoupper($paramPart)) {
                            $newProperty->add('PREF', '1');
                        } else {
                            $newProperty->add($param->name, $paramPart);
                        }
                    }
                    break;
                // These no longer exist in vCard 4
                case 'ENCODING':
                case 'CHARSET':
                    break;

                default:
                    $newProperty->add($param->name, $param->getParts());
                    break;
            }
        }
    }
protected function convertParameters40(Property $newProperty, array $parameters)
    {
        // Adding all parameters.
        foreach ($parameters as $param) {
            // vCard 2.1 allowed parameters with no name
            if ($param->noName) {
                $param->noName = false;
            }

            switch ($param->name) {
                // We need to see if there's any TYPE=PREF, because in vCard 4
                // that's now PREF=1.
                case 'TYPE':
                    foreach ($param->getParts() as $paramPart) {
                        if ('PREF' === strtoupper($paramPart)) {
                            $newProperty->add('PREF', '1');
                        } else {
                            $newProperty->add($param->name, $paramPart);
                        }
                    }
                    break;
                // These no longer exist in vCard 4
                case 'ENCODING':
                case 'CHARSET':
                    break;

                default:
                    $newProperty->add($param->name, $param->getParts());
                    break;
            }
        }
    }
protected function convertParameters40 ( Property $ newProperty , array $ parameters ) { // Adding all parameters. foreach ( $ parameters as $ param ) { // vCard 2.1 allowed parameters with no name if ( $ param -> noName ) { $ param -> noName = false ; } switch ( $ param -> name ) { // We need to see if there's any TYPE=PREF, because in vCard 4 // that's now PREF=1. case 'TYPE' : foreach ( $ param -> getParts ( ) as $ paramPart ) { if ( 'PREF' === strtoupper ( $ paramPart ) ) { $ newProperty -> add ( 'PREF' , '1' ) ; } else { $ newProperty -> add ( $ param -> name , $ paramPart ) ; } } break ; // These no longer exist in vCard 4 case 'ENCODING' : case 'CHARSET' : break ; default : $ newProperty -> add ( $ param -> name , $ param -> getParts ( ) ) ; break ; } } }
Adds parameters to a new property for vCard 4.0.

@param Property $newProperty
@param array    $parameters
Adds parameters to a new property for vCard 4 . 0 .