コード例 #1
0
 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
0
ファイル: class.messagemodel.php プロジェクト: Raz0r/Garden
 public function Delete($Where = '', $Limit = FALSE, $ResetData = FALSE)
 {
     parent::Delete($Where, $Limit, $ResetData);
     self::Messages(NULL);
 }
コード例 #3
0
 /**
  * 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
0
 /**
  * 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
0
ファイル: class.treemodel.php プロジェクト: ru4/arabbnota
 /**
  * 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
0
ファイル: class.banmodel.php プロジェクト: austins/vanilla
 /**
  * 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);
     }
 }