Example #1
0
 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);
 }
Example #2
0
 /**
  * {@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;
 }
Example #3
0
 public function onGetSyncResult($result)
 {
     $this->session->put($result);
 }
Example #4
0
 /**
  * {@inheritdoc}
  */
 public function syncContacts(array $contacs, array $delete = null)
 {
     $this->gateway()->sendSync($contacs, $delete);
     return $this->session->pull();
 }