/** * @param PURGE_OPTIONS $options * @access private */ protected function _purge($options) { /* remove sub-comments */ $comments = $this->sub_comments(); foreach ($comments as $comment) { $comment->purge($options); } /* Remove subscriptions */ $this->db->logged_query("DELETE LOW_PRIORITY FROM {$this->app->table_names->subscriptions} WHERE ref_id = {$this->id} AND kind = '" . Subscribe_comment . "'"); parent::_purge($options); }
/** * @param PURGE_OPTIONS $options * @access private */ protected function _purge($options) { $sub_folders = $this->sub_folders(); if (sizeof($sub_folders)) { foreach ($sub_folders as $folder) { /* If the data contains a cycle (where the parent = child), then ignore it. The folder will be removed anyway. */ if ($folder->id != $this->id) { $folder->purge($options); } } } // Remove permissions if ($this->defines_security()) { $security = $this->security_definition(); $security->purge(); } $tables = $this->app->table_names; /* Remove comments */ $this->_purge_foreign_key($tables->entries, 'id', $tables->comments, 'entry_id'); /* Remove entries */ $this->db->logged_query("DELETE LOW_PRIORITY FROM {$tables->entries} WHERE folder_id = {$this->id}"); /* Remove history items */ $this->db->logged_query("DELETE LOW_PRIORITY FROM {$tables->history_items} WHERE access_id = {$this->id} AND (object_type IN ('folder', 'entry', 'comment'))"); /* Remove subscriptions */ $this->db->logged_query("DELETE LOW_PRIORITY FROM {$tables->subscriptions} WHERE ref_id = {$this->id}"); $this->permissions_id = 0; $this->parent_id = 0; $this->root_id = 0; parent::_purge($options); }
/** * @param PURGE_OPTIONS $options * @access private */ protected function _purge($options) { $comment_query = $this->comment_query(); /** @var COMMENT[] $comments */ $comments = $comment_query->objects(); foreach ($comments as &$comment) { $comment->purge($options); } /* Remove subscriptions */ $this->db->logged_query("DELETE LOW_PRIORITY FROM {$this->app->table_names->subscriptions} WHERE ref_id = {$this->id} AND kind = '" . Subscribe_entry . "'"); parent::_purge($options); }