本文整理汇总了PHP中ZPush::getSyncObjectFromFolderClass方法的典型用法代码示例。如果您正苦于以下问题:PHP ZPush::getSyncObjectFromFolderClass方法的具体用法?PHP ZPush::getSyncObjectFromFolderClass怎么用?PHP ZPush::getSyncObjectFromFolderClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZPush
的用法示例。
在下文中一共展示了ZPush::getSyncObjectFromFolderClass方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Handle
//.........这里部分代码省略.........
if ($status == SYNC_STATUS_SUCCESS) {
$nchanges++;
}
// Foldertype sent when synching SMS
if (self::$decoder->getElementStartTag(SYNC_FOLDERTYPE)) {
$foldertype = self::$decoder->getElementContent();
ZLog::Write(LOGLEVEL_DEBUG, sprintf("HandleSync(): incoming data with foldertype '%s'", $foldertype));
if (!self::$decoder->getElementEndTag()) {
return false;
}
} else {
$foldertype = false;
}
$serverid = false;
if (self::$decoder->getElementStartTag(SYNC_SERVERENTRYID)) {
if (($serverid = self::$decoder->getElementContent()) !== false) {
if (!self::$decoder->getElementEndTag()) {
// end serverid
return false;
}
}
}
if (self::$decoder->getElementStartTag(SYNC_CLIENTENTRYID)) {
$clientid = self::$decoder->getElementContent();
if (!self::$decoder->getElementEndTag()) {
// end clientid
return false;
}
} else {
$clientid = false;
}
// Get the SyncMessage if sent
if (self::$decoder->getElementStartTag(SYNC_DATA)) {
$message = ZPush::getSyncObjectFromFolderClass($spa->GetContentClass());
$message->Decode(self::$decoder);
// set Ghosted fields
$message->emptySupported(self::$deviceManager->GetSupportedFields($spa->GetFolderId()));
if (!self::$decoder->getElementEndTag()) {
// end applicationdata
return false;
}
} else {
$message = false;
}
switch ($element[EN_TAG]) {
case SYNC_FETCH:
array_push($actiondata["fetchids"], $serverid);
break;
default:
// get the importer
if ($this->importer == false) {
$status = $this->getImporter($sc, $spa, $actiondata);
}
if ($status == SYNC_STATUS_SUCCESS) {
$this->importMessage($spa, $actiondata, $element[EN_TAG], $message, $clientid, $serverid, $foldertype, $nchanges);
} else {
ZLog::Write(LOGLEVEL_WARN, "Ignored incoming change, global status indicates problem.");
}
break;
}
if ($actiondata["fetchids"]) {
self::$topCollector->AnnounceInformation(sprintf("Fetching %d", $nchanges));
} else {
self::$topCollector->AnnounceInformation(sprintf("Incoming %d", $nchanges));
}
if (!self::$decoder->getElementEndTag()) {
示例2: Handle
//.........这里部分代码省略.........
if ($status == SYNC_STATUS_SUCCESS) {
$nchanges++;
}
// Foldertype sent when synching SMS
if (self::$decoder->getElementStartTag(SYNC_FOLDERTYPE)) {
$foldertype = self::$decoder->getElementContent();
ZLog::Write(LOGLEVEL_DEBUG, sprintf("HandleSync(): incoming data with foldertype '%s'", $foldertype));
if (!self::$decoder->getElementEndTag()) {
return false;
}
} else {
$foldertype = false;
}
$serverid = false;
if (self::$decoder->getElementStartTag(SYNC_SERVERENTRYID)) {
if (($serverid = self::$decoder->getElementContent()) !== false) {
if (!self::$decoder->getElementEndTag()) {
// end serverid
return false;
}
}
}
if (self::$decoder->getElementStartTag(SYNC_CLIENTENTRYID)) {
$clientid = self::$decoder->getElementContent();
if (!self::$decoder->getElementEndTag()) {
// end clientid
return false;
}
} else {
$clientid = false;
}
// Get the SyncMessage if sent
if (($el = self::$decoder->getElementStartTag(SYNC_DATA)) && $el[EN_FLAGS] & EN_FLAGS_CONTENT) {
$message = ZPush::getSyncObjectFromFolderClass($spa->GetContentClass());
// KOE ZO-42: OL sends Notes as Appointments
if ($spa->GetContentClass() == "Notes" && KOE_CAPABILITY_NOTES && self::$deviceManager->IsKoe()) {
ZLog::Write(LOGLEVEL_DEBUG, "HandleSync(): KOE sends Notes as Appointments, read as SyncAppointment and convert it into a SyncNote object.");
$message = new SyncAppointment();
$message->Decode(self::$decoder);
$note = new SyncNote();
if (isset($message->asbody)) {
$note->asbody = $message->asbody;
}
if (isset($message->categories)) {
$note->categories = $message->categories;
}
if (isset($message->subject)) {
$note->subject = $message->subject;
}
if (isset($message->dtstamp)) {
$note->lastmodified = $message->dtstamp;
}
// set SyncNote->Color from a color category
$note->SetColorFromCategory();
$message = $note;
} else {
$message->Decode(self::$decoder);
// set Ghosted fields
$message->emptySupported(self::$deviceManager->GetSupportedFields($spa->GetFolderId()));
}
if (!self::$decoder->getElementEndTag()) {
// end applicationdata
return false;
}
} else {
$message = false;