/** * Retrieves a single contact from the ContactsManager and parse * them to a usable format * TODO Could be a problem if too many contacts. * @return array */ public function getContact($id) { $activeAddressbooks = $this->getAddressBooksIDsForUser(); foreach ($activeAddressbooks as $activeAddressbook) { $contact = $this->backend->getCard($activeAddressbook, $this->backend->getCardUri($id)); if ($contact != null) { return new Contact($this->fbController, $this->backend, $contact['id'], $contact['uri'], $contact['lastmodified'], $contact['etag'], $activeAddressbook, VObject\Reader::read($contact["carddata"])); } } return false; }
/** * @expectedException InvalidArgumentException */ public function testGetCardUriFailed() { $this->backend->getCardUri(1); }
/** * @param object $id the unique identifier to a contact * @return bool successful or not * @since 5.0.0 */ public function delete($id) { $uri = $this->backend->getCardUri($id); return $this->backend->deleteCard($this->addressBookInfo['id'], $uri); }