Class vB_DataManager_PM

Description

Class to do data save/delete operations for PRIVATE MESSAGES Note: you may only do inserts with this class.

The following "info" options are supported:

  • savecopy (bool): whether to save a copy in the sent items folder
  • receipt (bool): whether to ask for a read receipt
  • cantrackpm (bool): whether the person sending the message has permission to track PMs
  • parentpmid (int): the parent PM this is in response to; will be resolved to the first message in a "thread"
  • replypmid (int): the PM this one is in response to
  • forward (bool): whether this is a forward of the parent (true) or a reply (false)

  • version: $Revision: 34509 $
  • date: $Date: 2009-12-15 18:58:30 -0600 (Tue, 15 Dec 2009) $

Located in /includes/class_dm_pm.php (line 34)

vB_DataManager
   |
   --vB_DataManager_PM
Variable Summary
Method Summary
 vB_DataManager_PM vB_DataManager_PM (vB_Registry &$registry, [integer $errtype = ERRTYPE_STANDARD])
 void post_save_each ([ $doquery = true], [ $result = false])
 boolean pre_save ([boolean $doquery = true])
 void set_condition ()
 boolean set_recipients (string $recipientlist,  &$permissions, [ $type = 'bcc'], array $permissions)
 boolean verify_message (string &$message)
 boolean verify_title (string &$title)
 boolean verify_touserarray (mixed &$tousers)
Variables
array $bitfields = array() (line 60)

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

For example: var $bitfields = array('options' => 'bf_misc_useroptions', 'permissions' => 'bf_misc_moderatorpermissions')


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.
array $condition_construct = array('pmtextid = %1$d', 'pmtextid') (line 101)

Condition template for update query


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.
bool $overridequota = false (line 81)

Switch to allow overriding of quota / receivepm errors when sending pm

array $pmtext = array() (line 74)

Array to store stuff to save to pm/pmtext tables

string $table = 'pmtext' (line 67)

The main table this class deals with


Redefinition of:
vB_DataManager::$table
Default table to be used in queries
array $validfields = array(
'pmtextid' => array(TYPE_UINT, REQ_INCR, VF_METHOD, 'verify_nonzero'),'fromuserid'=>array(TYPE_UINT,REQ_YES),'fromusername'=>array(TYPE_STR,REQ_YES),'title'=>array(TYPE_STR,REQ_YES,VF_METHOD),'message'=>array(TYPE_STR,REQ_YES,VF_METHOD),'touserarray'=>array(TYPE_NOCLEAN,REQ_YES,VF_METHOD),'iconid'=>array(TYPE_UINT,REQ_NO),'dateline'=>array(TYPE_UINT,REQ_NO),'showsignature'=>array(TYPE_BOOL,REQ_NO),'allowsmilie'=>array(TYPE_BOOL,REQ_NO),)
(line 41)

Array of recognised and required fields for private messages, and their types


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

Inherited Variables

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_PM (line 89)

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

vB_DataManager_PM vB_DataManager_PM (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
post_save_each (line 537)
void post_save_each ([ $doquery = true], [ $result = false])
  • $doquery
  • $result

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

Any checks to run immediately before saving. If returning false, the save will not take place.

  • return: True on success; false if an error occurred
boolean pre_save ([boolean $doquery = true])
  • boolean $doquery: Do the query?

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

Redefinition of:
vB_DataManager::set_condition()
Sets the condition to be used in WHERE clauses, based upon the $this->existing data and the $this->condition_constuct condition template.
set_recipients (line 278)

Accepts a list of recipients names to create the touserarray field

boolean set_recipients (string $recipientlist,  &$permissions, [ $type = 'bcc'], array $permissions)
  • array $permissions: array for sending user.
  • string $recipientlist: Single user name, or semi-colon separated list of user names
  • &$permissions
  • $type
verify_message (line 139)

Verifies that the message field is valid

boolean verify_message (string &$message)
  • string &$message: Message text
verify_title (line 118)

Verifies that the title field is valid

boolean verify_title (string &$title)
  • string &$title: Title / Subject
verify_touserarray (line 173)

Verifies that the touserarray is valid

boolean verify_touserarray (mixed &$tousers)
  • mixed &$tousers: To user array (array of userid/username pairs, or serialized array)

Inherited Methods

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:17 -0600 by phpDocumentor 1.4.3