public function onGetSyncResult($result) { $sync = 'Index: ' . $result->index . "\n"; $sync .= 'Sync Id: ' . $result->syncId . "\n"; $sync .= "Existing: \n\t\t" . preg_replace('/[a-z\\.@]+/i', '', implode("\n\t\t", (array) $result->existing)); $sync .= "\n\tNon existing: \n\t\t" . implode("\n\t\t", (array) $result->nonExisting); $parameters = ['result' => $sync]; $this->session->put($result); $this->fire(__FUNCTION__, $parameters); }
/** * {@inheritdoc} */ public function syncContacts(array $contacs, array $delete = null) { $this->gateway()->sendSync($contacs, $delete); $result = $this->session->pull(); if ($result && !empty($result->existing)) { $contacs = []; foreach ($result->existing as $key => $value) { $contacs[] = str_replace('+', '', $key); } $this->subscribe($contacs); } return $result; }
public function onGetSyncResult($result) { $this->session->put($result); }
/** * {@inheritdoc} */ public function syncContacts(array $contacs, array $delete = null) { $this->gateway()->sendSync($contacs, $delete); return $this->session->pull(); }