/**
  * parse categories from Tine20 model to VCard and attach it to VCard $card
  *
  * @param Tinebase_Record_Abstract $record
  * @param Sabre\VObject\Component $card
  */
 protected function _fromTine20ModelAddCategories(Tinebase_Record_Abstract $record, Sabre\VObject\Component $card)
 {
     if (!isset($record->tags)) {
         // If the record has not been populated yet with tags, let's try to get them all and update the record
         $record->tags = Tinebase_Tags::getInstance()->getTagsOfRecord($record);
     }
     if (isset($record->tags) && count($record->tags) > 0) {
         // we have some tags attached, so let's convert them and attach to the VCARD
         $card->add('CATEGORIES', (array) $record->tags->name);
     }
 }
Example #2
0
 public function setUID()
 {
     $uid = substr(md5(rand() . time()), 0, 10);
     $this->vobject->add('UID', $uid);
 }