Class vB_DataManager_Thread

Description

Class to do data save/delete operations for THREADS. Primarily useful when updating a thread's settings and you don't want to bring the first post into the picture.

  • version: $Revision: 34950 $
  • date: $Date: 2010-01-13 15:31:59 -0600 (Wed, 13 Jan 2010) $

Located in /includes/class_dm_threadpost.php (line 983)

vB_DataManager
   |
   --vB_DataManager_ThreadPost
      |
      --vB_DataManager_Thread
Direct descendents
Class Description
 class vB_DataManager_Thread_FirstPost Class to do data save/delete operations for a THREAD and its FIRST POST.
Variable Summary
 array $bitfields
 array $modlog
 string $table
 array $thread
 array $validfields
Method Summary
 vB_DataManager_Thread vB_DataManager_Thread (vB_Registry &$registry, [integer $errtype = ERRTYPE_STANDARD])
 mixed delete ([boolean $countposts = true], [boolean $physicaldel = true], [array $delinfo = NULL], [boolean $dolog = true])
 void do_set (string $fieldname, mixed &$value)
 void post_save_each ([ $doquery = true])
 void post_save_once ([ $doquery = true])
 void pre_save ([ $doquery = true])
 void verify_open ( &$open)
 void verify_prefixid ( &$prefixid)
 void verify_sticky ( &$sticky)
 bool verify_title (string &$title)
Variables
array $bitfields = array() (line 1026)

Array of field names that are bitfields, together with the name of the variable in the registry with the definitions.


Redefinition of:
vB_DataManager::$bitfields
Array of field names that are bitfields, together with the name of the variable in the registry with the definitions.

Redefined in descendants as:
array $condition_construct = array('threadid = %1$d', 'threadid') (line 1041)

Condition template for update query This is for use with sprintf(). First key is the where clause, further keys are the field names of the data to be used.


Redefinition of:
vB_DataManager::$condition_construct
Condition template for update query This is for use with sprintf(). First key is the where clause, further keys are the field names of the data to be used.

Redefined in descendants as:
array $modlog = array() (line 1055)

Array holding moderator log details to insert

string $table = 'thread' (line 1033)

The main table this class deals with


Redefinition of:
vB_DataManager::$table
Default table to be used in queries

Redefined in descendants as:
array $thread = array() (line 1048)

Array to store stuff to save to thread/post tables


Redefined in descendants as:
array $validfields = array(
'threadid' => array(TYPE_UINT, REQ_INCR),'title'=>array(TYPE_STR,REQ_YES,VF_METHOD),'firstpostid'=>array(TYPE_UINT,REQ_NO),'lastpost'=>array(TYPE_UINT,REQ_NO),'forumid'=>array(TYPE_UINT,REQ_YES),'pollid'=>array(TYPE_UINT,REQ_NO),'open'=>array(TYPE_UINT,REQ_AUTO,VF_METHOD),'replycount'=>array(TYPE_UINT,REQ_NO),'hiddencount'=>array(TYPE_UINT,REQ_NO),'deletedcount'=>array(TYPE_UINT,REQ_NO),'postusername'=>array(TYPE_STR,REQ_NO,VF_METHOD,'verify_username'),'postuserid'=>array(TYPE_UINT,REQ_NO,VF_METHOD,'verify_userid'),'lastposter'=>array(TYPE_STR,REQ_NO),'lastposterid'=>array(TYPE_UINT,REQ_NO),'lastpostid'=>array(TYPE_UINT,REQ_NO),'dateline'=>array(TYPE_UINT,REQ_AUTO),'views'=>array(TYPE_UINT,REQ_NO),'iconid'=>array(TYPE_UINT,REQ_NO,VF_METHOD),'notes'=>array(TYPE_STR,REQ_NO),'visible'=>array(TYPE_UINT,REQ_NO),'sticky'=>array(TYPE_UINT,REQ_NO,VF_METHOD),'votenum'=>array(TYPE_UINT,REQ_NO),'votetotal'=>array(TYPE_UINT,REQ_NO),'attach'=>array(TYPE_UINT,REQ_NO),'similar'=>array(TYPE_STR,REQ_AUTO),'prefixid'=>array(TYPE_STR,REQ_NO,VF_METHOD),'taglist'=>array(TYPE_STR,REQ_NO),'keywords'=>array(TYPE_STR,REQ_NO))
(line 990)

Array of recognised and required fields for threads, and their types


Redefinition of:
vB_DataManager::$validfields
Array of field names that are valid for this data object

Redefined in descendants as:

Inherited Variables

Inherited from vB_DataManager_ThreadPost

vB_DataManager_ThreadPost::$floodcheck
vB_DataManager_ThreadPost::$spamlog_insert

Inherited from vB_DataManager

vB_DataManager::$condition
vB_DataManager::$dbobject
vB_DataManager::$errors
vB_DataManager::$error_handler
vB_DataManager::$existing
vB_DataManager::$failure_callback
vB_DataManager::$hook_delete
vB_DataManager::$hook_postsave
vB_DataManager::$hook_presave
vB_DataManager::$hook_start
vB_DataManager::$info
vB_DataManager::$lamda
vB_DataManager::$presave_called
vB_DataManager::$rawfields
vB_DataManager::$registry
vB_DataManager::$setfields
Methods
Constructor vB_DataManager_Thread (line 1063)

Constructor - checks that the registry object has been passed correctly.

vB_DataManager_Thread vB_DataManager_Thread (vB_Registry &$registry, [integer $errtype = ERRTYPE_STANDARD])
  • vB_Registry &$registry: Instance of the vBulletin data registry object - expected to have the database object as one of its $this->db member.
  • integer $errtype: One of the ERRTYPE_x constants
delete (line 1469)

Deletes a thread

  • return: The number of affected rows
mixed delete ([boolean $countposts = true], [boolean $physicaldel = true], [array $delinfo = NULL], [boolean $dolog = true])
  • boolean $countposts: Whether to consider updating post counts, regardless of forum's settings
  • boolean $physicaldel: Whether to physically remove the thread from the database
  • array $delinfo: Array of information for a soft delete
  • boolean $dolog: Whether to add an entry to the moderator log

Redefinition of:
vB_DataManager::delete()
Deletes the specified data item from the database

Redefined in descendants as:
do_set (line 1076)

Takes valid data and sets it as part of the data to be saved

void do_set (string $fieldname, mixed &$value)
  • string $fieldname: The name of the field to which the supplied data should be applied
  • mixed &$value: The data itself

Redefinition of:
vB_DataManager::do_set()
Takes valid data and sets it as part of the data to be saved

Redefined in descendants as:
insert_moderator_log (line 1314)
void insert_moderator_log ()
post_save_each (line 1337)
void post_save_each ([ $doquery = true])
  • $doquery

Redefinition of:
vB_DataManager::post_save_each()
Additional data to update after a save call (such as denormalized values in other tables).

Redefined in descendants as:
post_save_once (line 1222)
void post_save_once ([ $doquery = true])
  • $doquery

Redefinition of:
vB_DataManager::post_save_once()
Additional data to update after a save call (such as denormalized values in other tables).

Redefined in descendants as:
pre_save (line 1237)
void pre_save ([ $doquery = true])
  • $doquery

Redefinition of:
vB_DataManager::pre_save()
Any checks to run immediately before saving. If returning false, the save will not take place.

Redefined in descendants as:
verify_open (line 1153)
void verify_open ( &$open)
  • &$open
verify_prefixid (line 1201)
void verify_prefixid ( &$prefixid)
  • &$prefixid
verify_sticky (line 1177)
void verify_sticky ( &$sticky)
  • &$sticky
verify_title (line 1130)

Verifies the title. Does the same processing as the general title verifier, but also requires there be a title.

  • return: Whether the title is valid
bool verify_title (string &$title)
  • string &$title: Title text

Redefinition of:
vB_DataManager_ThreadPost::verify_title()
Verifies the title is valid and sets up the title for saving (wordwrap, censor, etc).

Inherited Methods

Inherited From vB_DataManager_ThreadPost

 vB_DataManager_ThreadPost::vB_DataManager_ThreadPost()
 vB_DataManager_ThreadPost::akismet_mark_as_ham()
 vB_DataManager_ThreadPost::email_moderators()
 vB_DataManager_ThreadPost::fetch_attachment_count()
 vB_DataManager_ThreadPost::insert_dupehash()
 vB_DataManager_ThreadPost::insert_postlog_data()
 vB_DataManager_ThreadPost::post_save_each_post()
 vB_DataManager_ThreadPost::pre_save_post()
 vB_DataManager_ThreadPost::rebuild_keywords()
 vB_DataManager_ThreadPost::verify_iconid()
 vB_DataManager_ThreadPost::verify_pagetext()
 vB_DataManager_ThreadPost::verify_title()
 vB_DataManager_ThreadPost::verify_userid()

Inherited From vB_DataManager

 vB_DataManager::vB_DataManager()
 vB_DataManager::check_required()
 vB_DataManager::db_delete()
 vB_DataManager::db_insert()
 vB_DataManager::db_insert_ignore()
 vB_DataManager::db_update()
 vB_DataManager::delete()
 vB_DataManager::do_set()
 vB_DataManager::do_unset()
 vB_DataManager::error()
 vB_DataManager::fetch_field()
 vB_DataManager::fetch_insert_sql()
 vB_DataManager::fetch_update_sql()
 vB_DataManager::has_errors()
 vB_DataManager::post_delete()
 vB_DataManager::post_save_each()
 vB_DataManager::post_save_once()
 vB_DataManager::pre_delete()
 vB_DataManager::pre_save()
 vB_DataManager::save()
 vB_DataManager::set()
 vB_DataManager::setr()
 vB_DataManager::setr_info()
 vB_DataManager::set_bitfield()
 vB_DataManager::set_condition()
 vB_DataManager::set_error_handler()
 vB_DataManager::set_existing()
 vB_DataManager::set_failure_callback()
 vB_DataManager::set_info()
 vB_DataManager::strip_empty_bbcode()
 vB_DataManager::strip_empty_bbcode_callback()
 vB_DataManager::verify()
 vB_DataManager::verify_commalist()
 vB_DataManager::verify_date_array()
 vB_DataManager::verify_email()
 vB_DataManager::verify_image_count()
 vB_DataManager::verify_ipaddress()
 vB_DataManager::verify_link()
 vB_DataManager::verify_list()
 vB_DataManager::verify_md5()
 vB_DataManager::verify_nonempty()
 vB_DataManager::verify_nonzero()
 vB_DataManager::verify_nonzero_or_negone()
 vB_DataManager::verify_pagetext()
 vB_DataManager::verify_serialized()
 vB_DataManager::verify_spacelist()
 vB_DataManager::verify_userid()
 vB_DataManager::verify_username()

Documentation generated on Tue, 26 Jan 2010 15:15:31 -0600 by phpDocumentor 1.4.3