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


PHP Gdn_Model::Delete方法代码示例

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


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

示例1: Delete

 public function Delete($ActivityID)
 {
     // Get the activity first
     $Activity = $this->GetID($ActivityID);
     if (is_object($Activity)) {
         $Users = array();
         $Users[] = $Activity->ActivityUserID;
         if (is_numeric($Activity->RegardingUserID) && $Activity->RegardingUserID > 0) {
             $Users[] = $Activity->RegardingUserID;
         }
         // Update the user's dateupdated field so that profile pages will not
         // be cached and will reflect this deletion.
         $this->SQL->Update('User')->Set('DateUpdated', Gdn_Format::ToDateTime())->WhereIn('UserID', $Users)->Put();
         // Delete comments on the activity item
         parent::Delete(array('CommentActivityID' => $ActivityID), FALSE, TRUE);
         // Delete the activity item
         parent::Delete(array('ActivityID' => $ActivityID));
     }
 }
开发者ID:tautomers,项目名称:knoopvszombies,代码行数:19,代码来源:class.activitymodel.php

示例2: Delete

 public function Delete($Where = '', $Limit = FALSE, $ResetData = FALSE)
 {
     parent::Delete($Where, $Limit, $ResetData);
     self::Messages(NULL);
 }
开发者ID:Raz0r,项目名称:Garden,代码行数:5,代码来源:class.messagemodel.php

示例3: Delete

 /**
  * Delete a particular activity item.
  *
  * @since 2.0.0
  * @access public
  * @param int $ActivityID Unique ID of acitivity to be deleted.
  */
 public function Delete($ActivityID, $Options = array())
 {
     // Get the activity first.
     $Activity = $this->GetID($ActivityID);
     if ($Activity) {
         // Log the deletion.
         $Log = GetValue('Log', $Options);
         if ($Log) {
             LogModel::Insert($Log, 'Activity', $Activity);
         }
         // Delete comments on the activity item
         $this->SQL->Delete('ActivityComment', array('ActivityID' => $ActivityID));
         // Delete the activity item
         parent::Delete(array('ActivityID' => $ActivityID));
     }
 }
开发者ID:robhazkes,项目名称:Garden,代码行数:23,代码来源:class.activitymodel.php

示例4: Delete

 /**
  * Remove a ban.
  *
  * @since 2.0.18
  * @access public
  * 
  * @param array $Where
  * @param int $Limit
  * @param bool $ResetData
  */
 public function Delete($Where = '', $Limit = FALSE, $ResetData = FALSE)
 {
     if (isset($Where['BanID'])) {
         $OldBan = $this->GetID($Where['BanID'], DATASET_TYPE_ARRAY);
     }
     parent::Delete($Where, $Limit, $ResetData);
     if (isset($OldBan)) {
         $this->ApplyBan(NULL, $OldBan);
     }
 }
开发者ID:edward-tsai,项目名称:vanilla4china,代码行数:20,代码来源:class.banmodel.php

示例5: Delete

 /**
  * Delete element with number $id from the tree wihtout deleting it's children.
  * 
  * @param mixed $ID, id of node or node object.
  * @return mixed $Result.
  */
 public function Delete($ID, $Where = False)
 {
     list($LeftID, $RightID, $Depth, $NodeID) = $this->_NodeValues($ID);
     if (!$NodeID) {
         return False;
     }
     $this->Database->BeginTransaction();
     parent::Delete(array($this->PrimaryKey => $NodeID));
     $SqlValueDepth = "case\r\n\t\t\twhen {$this->LeftKey} between {$LeftID} and {$RightID} then {$this->DepthKey} - 1\r\n\t\t\telse {$this->DepthKey} end";
     $SqlValueRight = "case \r\n\t\t\twhen {$this->RightKey} between {$LeftID} and {$RightID} then {$this->RightKey} - 1\r\n\t\t\twhen {$this->RightKey} > {$RightID} then {$this->RightKey} - 2\r\n\t\t\telse {$this->RightKey} end";
     $SqlValueLeft = "case \r\n\t\t\twhen {$this->LeftKey} between {$LeftID} and {$RightID} then {$this->LeftKey} - 1\r\n\t\t\twhen {$this->LeftKey} > {$RightID} then {$this->LeftKey} - 2 \r\n\t\t\telse {$this->LeftKey} end";
     $Result = $this->SQL->Update($this->Name)->Set($this->DepthKey, $SqlValueDepth, False, False)->Set($this->RightKey, $SqlValueRight, False, False)->Set($this->LeftKey, $SqlValueLeft, False, False)->Where($this->RightKey . ' >', $LeftID, False, False)->Put();
     $this->Database->CommitTransaction();
     $this->CachedNodeResults = array();
     return $Result;
 }
开发者ID:ru4,项目名称:arabbnota,代码行数:22,代码来源:class.treemodel.php

示例6: delete

 /**
  * Remove a ban.
  *
  * @since 2.0.18
  * @access public
  *
  * @param array $Where
  * @param int $Limit
  * @param bool $ResetData
  */
 public function delete($Where = '', $Limit = false, $ResetData = false)
 {
     if (isset($Where['BanID'])) {
         $OldBan = $this->getID($Where['BanID'], DATASET_TYPE_ARRAY);
     }
     parent::Delete($Where, $Limit, $ResetData);
     if (isset($OldBan)) {
         $this->ApplyBan(null, $OldBan);
     }
 }
开发者ID:austins,项目名称:vanilla,代码行数:20,代码来源:class.banmodel.php


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