1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-19 08:52:22 +01:00

Contacts: Updates to backends API.

This commit is contained in:
Thomas Tanghus 2013-03-15 17:02:33 +01:00
parent 67474ebbc0
commit 5b08c7fcdc
3 changed files with 23 additions and 4 deletions

View File

@ -28,6 +28,12 @@ namespace OCA\Contacts\Backend;
abstract class AbstractBackend {
/**
* The name of the backend.
* @var string
*/
public $name;
/**
* Returns the list of addressbooks for a specific user.
*
@ -187,6 +193,6 @@ abstract class AbstractBackend {
* @param mixed $id
* @returns int | null
*/
public function lastModifiedContact($addressbookid, $contact) {
public function lastModifiedContact($addressbookid, $id) {
}
}

View File

@ -544,6 +544,21 @@ class Database extends AbstractBackend {
return true;
}
/**
* @brief Get the last modification time for a contact.
*
* Must return a UNIX time stamp or null if the backend
* doesn't support it.
*
* @param string $addressbookid
* @param mixed $id
* @returns int | null
*/
public function lastModifiedContact($addressbookid, $id) {
$contact = $this->getContact($addressbookid, $id);
return $contact ? $contact['lastmodified'] : null;
}
private function createAddressBookURI($displayname, $userid = null) {
$userid = $userid ? $userid : \OCP\User::getUser();
$name = str_replace(' ', '_', strtolower($displayname));
@ -572,6 +587,4 @@ class Database extends AbstractBackend {
return $newname;
}
public function lastModifiedContact($addressbookid, $id) {
}
}

View File

@ -30,7 +30,7 @@ use OCA\Contacts;
class Shared extends Database {
public $backendname = 'shared';
public $name = 'shared';
public $addressbooks = array();
/**