當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Artist::delete方法代碼示例

本文整理匯總了PHP中Artist::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP Artist::delete方法的具體用法?PHP Artist::delete怎麽用?PHP Artist::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Artist的用法示例。


在下文中一共展示了Artist::delete方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testDelete

 /**
  * @covers Artist::delete
  */
 public function testDelete()
 {
     $this->object->id = 'alpha';
     $this->assertFalse($this->object->delete(), 'Artist should not be deleted');
     $this->object->id = null;
     $this->assertFalse($this->object->delete(), 'Artist should not be deleted');
     $this->object->id = 2;
     $this->assertTrue($this->object->delete(), 'Artist should be deleted');
 }
開發者ID:nioc,項目名稱:web-music-player,代碼行數:12,代碼來源:ArtistTest.php

示例2: Artist

     if (!$api->checkAuth()) {
         //User not authentified/authorized
         return;
     }
     if (!$api->checkScope('admin')) {
         $api->output(403, 'Admin scope is required for deleting artist');
         //indicate the requester do not have the required scope for deleting artist
         return;
     }
     if (!$api->checkParameterExists('id', $id)) {
         $api->output(400, 'Artist identifier must be provided');
         //artist was not provided, return an error
         return;
     }
     $artist = new Artist($id);
     if (!$artist->delete()) {
         $api->output(500, 'Error during artist deletion');
         //something gone wrong :(
         return;
     }
     $api->output(204, null);
     break;
 case 'PUT':
     //update artist
     if (!$api->checkAuth()) {
         //User not authentified/authorized
         return;
     }
     if (!$api->checkScope('admin')) {
         $api->output(403, 'Admin scope is required for editing artist');
         //indicate the requester do not have the required scope for updating artist
開發者ID:nioc,項目名稱:web-music-player,代碼行數:31,代碼來源:artist.php

示例3: Notarizealbum

        $data = $data . $date . "," . $row[4] . "," . $row[5] . ";";
    }
    $stmt->closeCursor();
    $data = convertToUTF8($data);
    echo $data;
}
//partie suppression
if (isset($_GET['action']) && $_GET['action'] == 1) {
    $notarizealbum = new Notarizealbum($_GET['user'], $_GET['id']);
    $notarizealbum->delete($_GET['user'], $_GET['id']);
}
if (isset($_GET['action']) && $_GET['action'] == 2) {
    $notarizeartist = new Notarizeartist($_GET['user'], $_GET['id']);
    $notarizeartist->delete($_GET['user'], $_GET['id']);
}
if (isset($_GET['action']) && $_GET['action'] == 3) {
    $comment = new Comment($_GET['user'], $_GET['id']);
    $comment->delete($_GET['user'], $_GET['id']);
}
if (isset($_GET['type']) && $_GET['type'] == 'artist') {
    $artist = new Artist($_GET['id']);
    $artist->delete($_GET['id']);
}
if (isset($_GET['type']) && $_GET['type'] == 'album') {
    $album = new Album($_GET['id']);
    $album->delete($_GET['id']);
}
if (isset($_GET['type']) && $_GET['type'] == 'song') {
    $song = new Song($_GET['id']);
    $song->delete($_GET['id']);
}
開發者ID:parmindersingh1,項目名稱:musiclib,代碼行數:31,代碼來源:database.php


注:本文中的Artist::delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。