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


PHP UserDAO::delete方法代碼示例

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


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

示例1: addMarker

 public static function addMarker()
 {
     $film = new Film(null, "a film", "http://www.cnn.com");
     $updatedFilm = FilmDAO::insert($film);
     $user = new User(null, "test@test.com", "john doe", User::hash("password"));
     $updatedUser = UserDAO::add($user);
     $markerType = MarkerTypeDAO::getByName('Event');
     UserDAO::addFilm($updatedUser->getUserId(), $updatedFilm->getId());
     $myVideos = UserDAO::getFilms($updatedUser->getUserId());
     var_dump($myVideos);
     $array = array("id" => NULL, "filmId" => $updatedFilm->getId(), "markerId" => $markerType->getId(), "start" => 0.5, "end" => 0.6, "text" => "this is stuff", "target" => "target", "userId" => $updatedUser->getUserId());
     $marker = new FilmMarker($array);
     $markerWithId = FilmMarkerDAO::insertMarker($marker);
     //var_dump($markerWithId);
     UserDAO::removeFilm($updatedUser->getUserId(), $updatedFilm->getId());
     FilmMarkerDAO::delete($markerWithId->getId());
     UserDAO::delete($updatedUser->getUserId());
     FilmDAO::delete($film->getId());
 }
開發者ID:rochester-rcl,項目名稱:rcl-video-annotation,代碼行數:19,代碼來源:test.php

示例2: authorize

    echo json_encode($userDAO->selectById($id), JSON_NUMERIC_CHECK);
    exit;
});
$app->get('/users/login/:mail/?', authorize(), function ($mail) use($userDAO) {
    header("Content-Type: application/json");
    echo json_encode($userDAO->selectByMail($mail), JSON_NUMERIC_CHECK);
    exit;
});
$app->post('/users/?', authorize(), function () use($app, $userDAO) {
    header("Content-Type: application/json");
    $post = $app->request->post();
    if (empty($post)) {
        $post = (array) json_decode($app->request()->getBody());
    }
    echo json_encode($userDAO->insert($post), JSON_NUMERIC_CHECK);
    exit;
});
$app->delete('/users/:id/?', authorize(), function () use($userDAO) {
    header("Content-Type: application/json");
    echo json_encode($userDAO->delete());
    exit;
});
$app->put('/users/:id/?', function ($id) use($app, $userDAO) {
    header("Content-Type: application/json");
    $post = $app->request->post();
    if (empty($post)) {
        $post = (array) json_decode($app->request()->getBody());
    }
    echo json_encode($userDAO->update($id, $post), JSON_NUMERIC_CHECK);
    exit;
});
開發者ID:jessjoanna,項目名稱:Photochallenge,代碼行數:31,代碼來源:users.php

示例3: execute

 function execute()
 {
     $user = json_decode($_GET['user']);
     $dao = new UserDAO();
     $dao->delete($user);
 }
開發者ID:nazarmsx,項目名稱:Simple-Blog,代碼行數:6,代碼來源:databaseoperations.php


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