当前位置: 首页>>代码示例>>PHP>>正文


PHP ActivityModel::delete方法代码示例

本文整理汇总了PHP中ActivityModel::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP ActivityModel::delete方法的具体用法?PHP ActivityModel::delete怎么用?PHP ActivityModel::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ActivityModel的用法示例。


在下文中一共展示了ActivityModel::delete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 /**
  * Delete an activity item.
  *
  * @since 2.0.0
  * @access public
  *
  * @param int $ActivityID Unique ID of item to delete.
  * @param string $TransientKey Verify intent.
  */
 public function delete($ActivityID = '', $TransientKey = '')
 {
     $session = Gdn::session();
     if (!$session->validateTransientKey($TransientKey)) {
         throw permissionException();
     }
     if (!is_numeric($ActivityID)) {
         throw Gdn_UserException('Invalid ID');
     }
     if (!$this->ActivityModel->canDelete($this->ActivityModel->getID($ActivityID))) {
         throw permissionException();
     }
     $this->ActivityModel->delete($ActivityID);
     if ($this->_DeliveryType === DELIVERY_TYPE_ALL) {
         $target = Gdn::request()->get('Target');
         if ($target) {
             // Bail with a redirect if we got one.
             redirect($target);
         } else {
             // We got this as a full page somehow, so send them back to /activity.
             $this->RedirectUrl = url('activity');
         }
     }
     $this->render();
 }
开发者ID:RodSloan,项目名称:vanilla,代码行数:34,代码来源:class.activitycontroller.php

示例2: delete

 /**
  * Delete an activity item.
  *
  * @since 2.0.0
  * @access public
  *
  * @param int $ActivityID Unique ID of item to delete.
  * @param string $TransientKey Verify intent.
  */
 public function delete($ActivityID = '', $TransientKey = '')
 {
     $session = Gdn::session();
     if (!$session->validateTransientKey($TransientKey)) {
         throw permissionException();
     }
     if (!is_numeric($ActivityID)) {
         throw Gdn_UserException('Invalid ID');
     }
     if (!$this->ActivityModel->canDelete($this->ActivityModel->getID($ActivityID))) {
         throw permissionException();
     }
     $this->ActivityModel->delete($ActivityID);
     if ($this->_DeliveryType === DELIVERY_TYPE_ALL) {
         redirect(GetIncomingValue('Target', $this->SelfUrl));
     }
     // Still here? Getting a 404.
     $this->ControllerName = 'Home';
     $this->View = 'FileNotFound';
     $this->render();
 }
开发者ID:oMadMartigaNo,项目名称:readjust-forum,代码行数:30,代码来源:class.activitycontroller.php

示例3: delete

 public static function delete($id)
 {
     ActivityModel::delete($id);
 }
开发者ID:jbagaresgaray,项目名称:TABULATION-SYSTEM,代码行数:4,代码来源:controller.php

示例4: deleteactivityAction

 public function deleteactivityAction()
 {
     $activityid = $this->getRequest()->getParam('activityid', '0');
     //删除一条活动
     $table = new ActivityModel();
     $db = $table->getAdapter();
     $where = $db->quoteInto('id = ?', $activityid);
     if ($table->delete($where) > 0) {
         $this->view->info = 'success';
     } else {
         $this->view->info = 'fail';
     }
     $this->_forward('result2', 'globals');
 }
开发者ID:WebBigDoLeaf,项目名称:WebOne,代码行数:14,代码来源:ActivityController.php


注:本文中的ActivityModel::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。