/** * Return default handler objects for supported tasks. * @param string $handler_type Specific functionality required. * @param OBJECT_RENDERER_OPTIONS $options * @return object * @access private */ protected function _default_handler_for($handler_type, $options = null) { switch ($handler_type) { case Handler_print_renderer: case Handler_html_renderer: case Handler_text_renderer: include_once 'webcore/gui/history_item_renderer.php'; return new HISTORY_ITEM_RENDERER($this->app, $options); case Handler_mail: include_once 'webcore/mail/history_item_mail_renderer.php'; return new HISTORY_ITEM_MAIL_RENDERER($this->app); default: return parent::_default_handler_for($handler_type, $options); } }
/** * @param PURGE_OPTIONS $options * @access private */ protected function _purge($options) { parent::_purge($options); $tname = $this->secondary_table_name(); $this->db->logged_query("DELETE FROM {$tname} WHERE entry_to_branch_id = {$this->entry_to_branch_id}"); }
/** * @param PURGE_OPTIONS $options * @access private */ protected function _purge($options) { /* Remove history items for self */ $history_item = $this->handler_for(Handler_history_item); $this->assert(!empty($history_item->object_type), 'object_type cannot be empty.', '_purge', 'AUDITABLE'); $this->db->logged_query("DELETE LOW_PRIORITY FROM {$this->app->table_names->history_items} WHERE object_id = {$this->id} AND object_type = '{$history_item->object_type}'"); parent::_purge($options); }
/** * @param PURGE_OPTIONS $options * @access private */ protected function _purge($options) { if ($this->email) { $this->synchronize(); } $this->db->logged_query("DELETE LOW_PRIORITY FROM {$this->app->table_names->subscriptions} WHERE subscriber_id = {$this->id}"); parent::_purge($options); }
/** * Return default handler objects for supported tasks. * @param string $handler_type Specific functionality required. * @param object $options * @return object * @access private */ protected function _default_handler_for($handler_type, $options = null) { switch ($handler_type) { case Handler_html_renderer: include_once 'webcore/gui/icon_renderer.php'; return new ICON_RENDERER($this->context); case Handler_commands: include_once 'webcore/cmd/icon_commands.php'; return new ICON_COMMANDS($this); default: return parent::_default_handler_for($handler_type, $options); } }
/** * Delete the given object. * @param UNIQUE_OBJECT $obj * @access private */ public function commit($obj) { $obj->purge(); }