Esempio n. 1
0
 /**
  * @return bool
  */
 protected function tryMapUrlAttribute(VCard\VCardElement $element, array &$fields)
 {
     $attrs = $element->getAttributesByName('URL');
     $qty = 0;
     foreach ($attrs as $attr) {
         $value = $attr->getValue();
         if ($value === '') {
             continue;
         }
         if (!isset($fields['FM'])) {
             $fields['FM'] = array();
         }
         if (!isset($fields['FM']['WEB'])) {
             $fields['FM']['WEB'] = array();
         }
         $qty++;
         $fields['FM']['WEB']["n{$qty}"] = array('VALUE' => $value, 'VALUE_TYPE' => 'WORK');
     }
     if ($qty > 0) {
         $this->mappedMultiFields['WEB'] = array('WORK');
     }
     return $qty > 0;
 }