Esempio n. 1
0
 /**
  * @return bool
  */
 public function readElement()
 {
     if ($this->element !== null) {
         $this->element = null;
     }
     if (!$this->open()) {
         return false;
     }
     if (!$this->readElementContent()) {
         return false;
     }
     $this->element = VCardElement::parseFromString($this->elementContent);
     return true;
 }
Esempio n. 2
0
 /**
  * @return bool
  */
 protected function tryMapFileAttribute(VCard\VCardElement $element, $attrName, $fieildName, array &$fields)
 {
     $attr = $element->getFirstAttributeByName($attrName);
     if ($attr === null) {
         return false;
     }
     $file = VCard\VCardFile::createFromAttribute($attr);
     if ($file === null) {
         return false;
     }
     $fileInfo = $file->getFileInfo();
     if ($fileInfo === null) {
         return false;
     }
     $fields[$fieildName] = array_merge($fileInfo, array('MODULE_ID' => 'crm'));
     $this->mappedFields[] = $fieildName;
     return true;
 }