diff --git a/lib/backend/abstractbackend.php b/lib/backend/abstractbackend.php index b6cc14d1..d9e4cadb 100644 --- a/lib/backend/abstractbackend.php +++ b/lib/backend/abstractbackend.php @@ -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) { } } \ No newline at end of file diff --git a/lib/backend/database.php b/lib/backend/database.php index a9dcdb28..4c7e1482 100644 --- a/lib/backend/database.php +++ b/lib/backend/database.php @@ -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) { - } } diff --git a/lib/backend/shared.php b/lib/backend/shared.php index 3b04a2f5..95163859 100644 --- a/lib/backend/shared.php +++ b/lib/backend/shared.php @@ -30,7 +30,7 @@ use OCA\Contacts; class Shared extends Database { - public $backendname = 'shared'; + public $name = 'shared'; public $addressbooks = array(); /**