ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Public Member Functions | |
__construct (\PDO $pdo) | |
Sets up the object. More... | |
getAddressBooksForUser ($principalUri) | |
Returns the list of addressbooks for a specific user. More... | |
updateAddressBook ($addressBookId, \Sabre\DAV\PropPatch $propPatch) | |
Updates properties for an address book. More... | |
createAddressBook ($principalUri, $url, array $properties) | |
Creates a new address book. More... | |
deleteAddressBook ($addressBookId) | |
Deletes an entire addressbook and all its contents. More... | |
getCards ($addressbookId) | |
Returns all cards for a specific addressbook id. More... | |
getCard ($addressBookId, $cardUri) | |
Returns a specific card. More... | |
getMultipleCards ($addressBookId, array $uris) | |
Returns a list of cards. More... | |
createCard ($addressBookId, $cardUri, $cardData) | |
Creates a new card. More... | |
updateCard ($addressBookId, $cardUri, $cardData) | |
Updates a card. More... | |
deleteCard ($addressBookId, $cardUri) | |
Deletes a card. More... | |
getChangesForAddressBook ($addressBookId, $syncToken, $syncLevel, $limit=null) | |
The getChanges method returns all the changes that have happened, since the specified syncToken in the specified address book. More... | |
Public Member Functions inherited from Sabre\CardDAV\Backend\AbstractBackend | |
getMultipleCards ($addressBookId, array $uris) | |
Returns a list of cards. More... | |
Data Fields | |
$addressBooksTableName = 'addressbooks' | |
The PDO table name used to store addressbooks. More... | |
$cardsTableName = 'cards' | |
The PDO table name used to store cards. More... | |
$addressBookChangesTableName = 'addressbookchanges' | |
Protected Member Functions | |
addChange ($addressBookId, $objectUri, $operation) | |
Adds a change record to the addressbookchanges table. More... | |
Protected Attributes | |
$pdo | |
This CardDAV backend uses PDO to store addressbooks
Sabre\CardDAV\Backend\PDO::__construct | ( | \PDO | $pdo | ) |
Sets up the object.
\PDO | $pdo |
Definition at line 48 of file PDO.php.
References Sabre\CardDAV\Backend\PDO\$pdo.
|
protected |
Adds a change record to the addressbookchanges table.
mixed | $addressBookId | |
string | $objectUri | |
int | $operation | 1 = add, 2 = modify, 3 = delete |
Definition at line 535 of file PDO.php.
References $stmt.
Referenced by Sabre\CardDAV\Backend\PDO\createCard(), Sabre\CardDAV\Backend\PDO\deleteCard(), Sabre\CardDAV\Backend\PDO\updateAddressBook(), and Sabre\CardDAV\Backend\PDO\updateCard().
Sabre\CardDAV\Backend\PDO::createAddressBook | ( | $principalUri, | |
$url, | |||
array | $properties | ||
) |
Creates a new address book.
string | $principalUri | |
string | $url | Just the 'basename' of the url. |
array | $properties |
Implements Sabre\CardDAV\Backend\BackendInterface.
Definition at line 156 of file PDO.php.
References $query, $stmt, $url, $values, and Sabre\CardDAV\Plugin\NS_CARDDAV.
Sabre\CardDAV\Backend\PDO::createCard | ( | $addressBookId, | |
$cardUri, | |||
$cardData | |||
) |
Creates a new card.
The addressbook id will be passed as the first argument. This is the same id as it is returned from the getAddressBooksForUser method.
The cardUri is a base uri, and doesn't include the full path. The cardData argument is the vcard body, and is passed as a string.
It is possible to return an ETag from this method. This ETag is for the newly created resource, and must be enclosed with double quotes (that is, the string itself must contain the double quotes).
You should only return the ETag if you store the carddata as-is. If a subsequent GET request on the same card does not have the same body, byte-by-byte and you did return an ETag here, clients tend to get confused.
If you don't return an ETag, you can just return null.
mixed | $addressBookId | |
string | $cardUri | |
string | $cardData |
Implements Sabre\CardDAV\Backend\BackendInterface.
Definition at line 325 of file PDO.php.
References $stmt, and Sabre\CardDAV\Backend\PDO\addChange().
Sabre\CardDAV\Backend\PDO::deleteAddressBook | ( | $addressBookId | ) |
Deletes an entire addressbook and all its contents.
int | $addressBookId |
Implements Sabre\CardDAV\Backend\BackendInterface.
Definition at line 195 of file PDO.php.
References $stmt.
Sabre\CardDAV\Backend\PDO::deleteCard | ( | $addressBookId, | |
$cardUri | |||
) |
Deletes a card.
mixed | $addressBookId | |
string | $cardUri |
Implements Sabre\CardDAV\Backend\BackendInterface.
Definition at line 398 of file PDO.php.
References $stmt, and Sabre\CardDAV\Backend\PDO\addChange().
Sabre\CardDAV\Backend\PDO::getAddressBooksForUser | ( | $principalUri | ) |
Returns the list of addressbooks for a specific user.
string | $principalUri |
Implements Sabre\CardDAV\Backend\BackendInterface.
Definition at line 60 of file PDO.php.
References $row, $stmt, and Sabre\CardDAV\Plugin\NS_CARDDAV.
Sabre\CardDAV\Backend\PDO::getCard | ( | $addressBookId, | |
$cardUri | |||
) |
Returns a specific card.
The same set of properties must be returned as with getCards. The only exception is that 'carddata' is absolutely required.
If the card does not exist, you must return false.
mixed | $addressBookId | |
string | $cardUri |
Implements Sabre\CardDAV\Backend\BackendInterface.
Definition at line 254 of file PDO.php.
References $result, and $stmt.
Sabre\CardDAV\Backend\PDO::getCards | ( | $addressbookId | ) |
Returns all cards for a specific addressbook id.
This method should return the following properties for each card:
It's recommended to also return the following properties:
If these last two properties are provided, less time will be spent calculating them. If they are specified, you can also ommit carddata. This may speed up certain requests, especially with large cards.
mixed | $addressbookId |
Implements Sabre\CardDAV\Backend\BackendInterface.
Definition at line 227 of file PDO.php.
References $result, $row, and $stmt.
Sabre\CardDAV\Backend\PDO::getChangesForAddressBook | ( | $addressBookId, | |
$syncToken, | |||
$syncLevel, | |||
$limit = null |
|||
) |
The getChanges method returns all the changes that have happened, since the specified syncToken in the specified address book.
This function should return an array, such as the following:
[ 'syncToken' => 'The current synctoken', 'added' => [ 'new.txt', ], 'modified' => [ 'updated.txt', ], 'deleted' => [ 'foo.php.bak', 'old.txt' ] ];
The returned syncToken property should reflect the current syncToken of the addressbook, as reported in the {http://sabredav.org/ns}sync-token property. This is needed here too, to ensure the operation is atomic.
If the $syncToken argument is specified as null, this is an initial sync, and all members should be reported.
The modified property is an array of nodenames that have changed since the last token.
The deleted property is an array with nodenames, that have been deleted from collection.
The $syncLevel argument is basically the 'depth' of the report. If it's 1, you only have to report changes that happened only directly in immediate descendants. If it's 2, it should also include changes from the nodes below the child collections. (grandchildren)
The $limit argument allows a client to specify how many results should be returned at most. If the limit is not specified, it should be treated as infinite.
If the limit (infinite or not) is higher than you're willing to return, you should throw a Sabre() exception.
If the syncToken is expired (due to data cleanup) or unknown, you must return null.
The limit is 'suggestive'. You are free to ignore it.
string | $addressBookId | |
string | $syncToken | |
int | $syncLevel | |
int | $limit |
Implements Sabre\CardDAV\Backend\SyncSupport.
Definition at line 465 of file PDO.php.
Sabre\CardDAV\Backend\PDO::getMultipleCards | ( | $addressBookId, | |
array | $uris | ||
) |
Returns a list of cards.
This method should work identical to getCard, but instead return all the cards in the list as an array.
If the backend supports this, it may allow for some speed-ups.
mixed | $addressBookId | |
array | $uris |
Implements Sabre\CardDAV\Backend\BackendInterface.
Definition at line 281 of file PDO.php.
References $query, $result, $row, and $stmt.
Sabre\CardDAV\Backend\PDO::updateAddressBook | ( | $addressBookId, | |
\Sabre\DAV\PropPatch | $propPatch | ||
) |
Updates properties for an address book.
The list of mutations is stored in a Sabre object. To do the actual updates, you must tell this object which properties you're going to process with the handle() method.
Calling the handle method is like telling the PropPatch object "I promise I can handle updating this property".
Read the PropPatch documentation for more info and examples.
string | $addressBookId | |
\Sabre\DAV\PropPatch | $propPatch |
Implements Sabre\CardDAV\Backend\BackendInterface.
Definition at line 102 of file PDO.php.
References $key, $query, $stmt, Sabre\CardDAV\Backend\PDO\addChange(), and Sabre\CardDAV\Plugin\NS_CARDDAV.
Sabre\CardDAV\Backend\PDO::updateCard | ( | $addressBookId, | |
$cardUri, | |||
$cardData | |||
) |
Updates a card.
The addressbook id will be passed as the first argument. This is the same id as it is returned from the getAddressBooksForUser method.
The cardUri is a base uri, and doesn't include the full path. The cardData argument is the vcard body, and is passed as a string.
It is possible to return an ETag from this method. This ETag should match that of the updated resource, and must be enclosed with double quotes (that is: the string itself must contain the actual quotes).
You should only return the ETag if you store the carddata as-is. If a subsequent GET request on the same card does not have the same body, byte-by-byte and you did return an ETag here, clients tend to get confused.
If you don't return an ETag, you can just return null.
mixed | $addressBookId | |
string | $cardUri | |
string | $cardData |
Implements Sabre\CardDAV\Backend\BackendInterface.
Definition at line 371 of file PDO.php.
References $stmt, and Sabre\CardDAV\Backend\PDO\addChange().
Sabre\CardDAV\Backend\PDO::$addressBookChangesTableName = 'addressbookchanges' |
Sabre\CardDAV\Backend\PDO::$addressBooksTableName = 'addressbooks' |
Sabre\CardDAV\Backend\PDO::$cardsTableName = 'cards' |
|
protected |
Definition at line 24 of file PDO.php.
Referenced by Sabre\CardDAV\Backend\PDO\__construct().