コード例 #1
0
 /**
  * Delete the address book from backend
  *
  * @return bool
  */
 public function delete()
 {
     if (!$this->hasPermission(\OCP\PERMISSION_DELETE)) {
         throw new \Exception(self::$l10n->t('You don\'t have permissions to delete the address book.'), Http::STATUS_FORBIDDEN);
     }
     return $this->backend->deleteAddressBook($this->getId());
 }
コード例 #2
0
ファイル: backend_test.php プロジェクト: gvde/contacts-8
 public function testDeleteAddressBook()
 {
     $this->assertTrue($this->backend->deleteAddressBook('foo'));
     $this->assertEquals(array(), $this->backend->addressBooks);
 }