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


PHP Survey::remove方法代碼示例

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


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

示例1: remove

 public function remove()
 {
     if (!$this->exists()) {
         return false;
     }
     // Remove all of the user's surveys
     foreach ($this->surveys as $surveyID) {
         $survey = new Survey($surveyID);
         $survey->remove();
     }
     // And the container which references them
     Redis::del("User:{$this->id}:surveys");
     // And the username-userid reference
     Redis::set("User:username:{$this->username}");
     parent::remove();
 }
開發者ID:nickyleach,項目名稱:OSTSurvey,代碼行數:16,代碼來源:User.php

示例2: delete

 public function delete($id)
 {
     $survey = new Survey($id);
     if (!$survey->exists()) {
         $this->message = "Survey not found";
         $this->status = 404;
         return;
     }
     if ($survey->ownerID != Session::$user['id']) {
         $this->message = "Unauthorized";
         $this->status = 403;
         return;
     }
     $survey->remove();
     $this->message = "Survey removed";
     $this->status = 204;
 }
開發者ID:nickyleach,項目名稱:OSTSurvey,代碼行數:17,代碼來源:SurveysAPIController.php

示例3: showRemoveSurveyRes

 function showRemoveSurveyRes()
 {
     /* update last page */
     $_SESSION['LASTPAGE'] = 'sysadmin.surveys';
     $displaySysAdmin = new DisplaySysAdmin();
     $suid = getFromSessionParams('suid');
     if ($suid != '') {
         //remove
         $survey = new Survey($suid);
         /* remove sections */
         $sections = $survey->getSections();
         foreach ($sections as $section) {
             $section->remove();
             /* remove variables */
             $variables = $survey->getVariableDescriptives($section->getSeid());
             foreach ($variables as $variable) {
                 $variable->remove();
             }
         }
         /* remove types */
         $types = $survey->getTypes();
         foreach ($types as $type) {
             $type->remove();
         }
         /* remove types */
         $groups = $survey->getGroups();
         foreach ($groups as $group) {
             $group->remove();
         }
         /* remove versions */
         $versions = $survey->getVersions();
         foreach ($versions as $version) {
             $version->remove();
         }
         /* remove survey */
         $survey->remove();
         /* update users */
         $users = new Users();
         $users = $users->getUsers();
         foreach ($users as $u) {
             $u->removeSurvey($suid);
             $u->saveChanges();
         }
         /* return result */
         return $displaySysAdmin->showSurveys($displaySysAdmin->displaySuccess(Language::messageSurveyRemoved($survey->getName())));
     } else {
         return $displaySysAdmin->showSurveys();
     }
 }
開發者ID:nubissurveying,項目名稱:nubis,代碼行數:49,代碼來源:sysadmin.php


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