vB_DataManager_MultipleAbstract class to do data update operations for a particular data type (such as user, thread, post etc.).
Works on multiple records simultaneously. Updates will occur on all records matching set_condition().
Located in /includes/class_dm.php (line 1620)
| Class | Description |
|---|---|
vB_DataManager_ThreadRate_Multiple
|
Class to do data update operations for multiple THREADRATE simultaneously |
vB_DataManager_Post_Multiple
|
Class to do data update operations for multiple POSTS simultaneously |
vB_DataManager_Thread_Multiple
|
Class to do data update operations for multiple THREADS simultaneously |
vB_DataManager_User_Multiple
|
Class to do data update operations for multiple USERS simultaneously |
vB_DataManager_Multiple
vB_DataManager_Multiple
(vB_Registry &$registry, [integer $errtype = ERRTYPE_STANDARD])
void
batch_iterate
(string|resource $records, callback $callback, [integer $batch_size = 500], [array $args = array()])
boolean
set
(string $fieldname, mixed $value, [boolean $clean = true], [boolean $doverify = true], string 4)
vB_DataManager
$base_object
= null (line 1657)
The base object of type $class_name. This is created in the constructor for optimization purposes. Do not change this object.
array
$children
= array() (line 1675)
Holds an array of vB_DataManager objects that matched the condition specified in a call to set_condition(). The first object in this array becomes the "master".
Changes are done to it first; changes are not pushed to the rest of the matches until copy_changes() is called.
string
$class_name
= 'vB_DataManager' (line 1649)
The name of the class to instantiate for each matching. It is assumed to exist! It should be a subclass of vB_DataManager.
vB_Database
$dbobject
= null (line 1634)
The vBulletin database object
integer
$error_handler
= ERRTYPE_STANDARD (line 1641)
The error handler for the child objects. Should be one of the ERRTYPE_* constants.
string
$primary_id
= 'dataid' (line 1665)
The name of the primary ID column that is used to uniquely identify records retrieved.
This will be used to build the condition in all update queries!
array
$primary_ids
= array() (line 1684)
Array of the primary ID fields (as specified by $primary_id) of any records that matched in a call to set_condition(). This is used to build the condition when saving.
vB_Registry
$registry
= null (line 1627)
The vBulletin registry object
Constructor vB_DataManager_Multiple (line 1692)
Constructor - checks that the registry object has been passed correctly.
add_existing (line 1758)
This function adds an existing record to the data manager. This is helpful if you have already executed the query to grab the data, for example.
batch_iterate (line 1992)
This function iterate over a large result set, only processing records in
batches to keep the memory usage reasonable. After a batch has been collected, a reference to this object is passed to a callback function. That function will update any columns necessary. This function will the save the changes and start on a new batch.
Callback function first argument must be a reference to a vB_DataManager_Multiple object. Additional arguments should be passed to this function in an array.
copy_changes (line 1880)
Pushes the changes made to the "master" child to the rest.
execute_query (line 1948)
Executes the necessary query/queries to update the records
fetch_field (line 1795)
Allows you to fetch the value of a field whose value was changed.
This does not look at existing data as it may vary from record to record!
fetch_query (line 1781)
Builds the SQL to run to fetch records. This must be overridden by a child class!
reset (line 1971)
Removes the records stored in the manager, resetting it (essentially) to its start state.
save (line 1905)
Saves the data from the object into the specified database tables
set (line 1831)
Sets the supplied data to be part of the data to be saved
set_bitfield (line 1851)
Sets a bit in a bitfield
set_condition (line 1733)
Queries for matching records based on the condition specified, and sets up the manager to make modifications to those records.
set_info (line 1868)
Rather like set(), but sets data into the $this->info array instead
Documentation generated on Tue, 26 Jan 2010 15:15:09 -0600 by phpDocumentor 1.4.3