本文整理汇总了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));
}
}
示例2: Delete
public function Delete($Where = '', $Limit = FALSE, $ResetData = FALSE)
{
parent::Delete($Where, $Limit, $ResetData);
self::Messages(NULL);
}
示例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));
}
}
示例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);
}
}
示例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;
}
示例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);
}
}