class vB_Template_Merge_Data

Class that separates the data retrival aspect from merging for easier variation and reduced dependencies.

Properties

protected vB_Registry $registry Registry object
protected array $conditions Array of extra conditions to add to the data fetch
int $start_offset Number of records to offset from the first match. Use this to start the second (or later) page of a merge set.
int $batch_size Number of records to return. Works in conjuction with $start_offset above.

Methods

__construct(vB_Registry $registry)

Constructor.

add_condition(string $condition)

Adds an additional condition to the data fetch query.

resource
fetch_merge_candidates()

Fetches the result set containing all (remaining) merge candidates.

bool
can_merge_template(array $template_info)

Determines whether a merge should be attempted on a template.

Details

at line 359
__construct(vB_Registry $registry)

Constructor.

Parameters

vB_Registry $registry Main registry object

at line 370
add_condition(string $condition)

Adds an additional condition to the data fetch query.

The condition is just raw SQL put together with AND's.

Parameters

string $condition Condition text

at line 383
resource fetch_merge_candidates()

Fetches the result set containing all (remaining) merge candidates.

Can be offset from the start via the start_offset member. Needs to return information about the custom, origin (old), and new versions of a particular template.

Return Value

resource DB result object

at line 431
bool can_merge_template(array $template_info)

Determines whether a merge should be attempted on a template.

Parameters

array $template_info Array of template info. Record returned by data method.

Return Value

bool True if a merge should be attempted.