Class vB_DataManager_Attachment

Description

Abstract class to do data save/delete operations for ATTACHMENTS.

You should call the fetch_library() function to instantiate the correct object based on how attachments are being stored unless calling the multiple datamanager. There is no support for manipulating the FS via the multiple datamanager at the present.

  • version: $Revision: 26600 $
  • date: $Date: 2008-05-08 10:08:34 -0500 (Thu, 08 May 2008) $

Located in /includes/class_dm_attachment.php (line 32)

vB_DataManager
   |
   --vB_DataManager_Attachment
Direct descendents
Class Description
 class vB_DataManager_Attachment_Database Class to do data save/delete operations for ATTACHMENTS in the DATABASE.
 class vB_DataManager_Attachment_Filesystem Class to do data save/delete operations for ATTACHMENTS in the FILE SYSTEM.
Variable Summary
 array $lists
 boolean $log
 string $table
 array $validfields
Method Summary
 vB_DataManager_Attachment vB_DataManager_Attachment (vB_Registry &$registry, [integer $errtype = ERRTYPE_STANDARD])
 vB_DataManager_Attachment &fetch_library (vB_Registry &$registry, [integer $errtype = ERRTYPE_ARRAY])
 void post_delete ([Boolean $doquery = true])
 void post_save_each ([boolean $doquery = true])
 void pre_delete ([Boolean $doquery = true])
 boolean pre_save ([boolean $doquery = true])
 mixed save ([ $doquery = true], [ $delayed = false])
 boolean verify_filedata (integer &$filedata)
 boolean verify_filename (filename &$filename)
 boolean verify_md5_alt (string &$md5)
 boolean verify_thumbnail (integer &$thumbnail)
Variables
array $condition_construct = array('attachmentid = %1$d', 'attachmentid') (line 84)

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.
array $lists = array() (line 69)

Storage holder

  • var: Storage Holder
boolean $log = true (line 76)

Switch to control modlog update

string $table = 'attachment' (line 62)

The main table this class deals with


Redefinition of:
vB_DataManager::$table
Default table to be used in queries
array $validfields = array(
'attachmentid' => array(TYPE_UINT, REQ_INCR, VF_METHOD, 'verify_nonzero'),'userid'=>array(TYPE_UINT,REQ_YES),'postid'=>array(TYPE_UINT,REQ_NO),'dateline'=>array(TYPE_UNIXTIME,REQ_AUTO),'filename'=>array(TYPE_STR,REQ_YES,VF_METHOD,'verify_filename'),'filedata'=>array(TYPE_BINARY,REQ_NO,VF_METHOD),'filesize'=>array(TYPE_UINT,REQ_YES),'visible'=>array(TYPE_UINT,REQ_NO),'counter'=>array(TYPE_UINT,REQ_NO),'filehash'=>array(TYPE_STR,REQ_YES,VF_METHOD,'verify_md5'),'posthash'=>array(TYPE_STR,REQ_NO,VF_METHOD,'verify_md5_alt'),'thumbnail'=>array(TYPE_BINARY,REQ_NO,VF_METHOD),'thumbnail_dateline'=>array(TYPE_UNIXTIME,REQ_AUTO),'thumbnail_filesize'=>array(TYPE_UINT,REQ_NO),'extension'=>array(TYPE_STR,REQ_YES),)
(line 39)

Array of recognized and required fields for attachment inserts


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

Inherited Variables

Inherited from vB_DataManager

vB_DataManager::$bitfields
vB_DataManager::$condition
vB_DataManager::$dbobject
vB_DataManager::$errors
vB_DataManager::$error_handler
vB_DataManager::$existing
vB_DataManager::$failure_callback
vB_DataManager::$info
vB_DataManager::$lamda
vB_DataManager::$presave_called
vB_DataManager::$rawfields
vB_DataManager::$registry
vB_DataManager::$setfields
Methods
Constructor vB_DataManager_Attachment (line 92)

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

vB_DataManager_Attachment vB_DataManager_Attachment (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
fetch_library (line 107)

Fetches the appropriate subclassed based on how attachments are being stored.

  • return: Subclass of vB_DataManager_Attachment
vB_DataManager_Attachment &fetch_library (vB_Registry &$registry, [integer $errtype = ERRTYPE_ARRAY])
  • 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_delete (line 408)

Any code to run after deleting

void post_delete ([Boolean $doquery = true])
  • Boolean $doquery: Do the query?

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

Additional data to update after a save call (such as denormalized values in other tables).

In batch updates, is executed for each record updated.

void post_save_each ([boolean $doquery = true])
  • boolean $doquery: Do the query?

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:
pre_delete (line 311)

Any code to run before deleting. Builds lists and updates mod log

void pre_delete ([Boolean $doquery = true])
  • Boolean $doquery: Do the query?

Redefinition of:
vB_DataManager::pre_delete()
Additional data to update before a delete call (such as denormalized values in other tables).
pre_save (line 230)

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.

Redefined in descendants as:
save (line 191)

Saves the data from the object into the specified database tables Overwrites parent

  • return: If this was an INSERT query, the INSERT ID is returned
mixed save ([ $doquery = true], [ $delayed = false])
  • $doquery
  • $delayed

Redefinition of:
vB_DataManager::save()
Saves the data from the object into the specified database tables
verify_filedata (line 174)

Set the filehash/filesize of the file

boolean verify_filedata (integer &$filedata)
  • integer &$filedata: Maximum posts per page
verify_filename (line 133)

Set the extension of the filename

boolean verify_filename (filename &$filename)
  • filename &$filename
verify_md5_alt (line 121)

Verify that posthash is either md5 or empty

boolean verify_md5_alt (string &$md5)
  • string &$md5: the md5
verify_thumbnail (line 158)

Set the filesize of the thumbnail

boolean verify_thumbnail (integer &$thumbnail)
  • integer &$thumbnail: Maximum posts per page

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_pagetext()
 vB_DataManager::verify_serialized()
 vB_DataManager::verify_spacelist()
 vB_DataManager::verify_userid()
 vB_DataManager::verify_username()

Documentation generated on Fri, 09 May 2008 09:01:00 -0500 by phpDocumentor 1.4.1