Automattic\WooCommerce\Database\Migrations

MetaToCustomTableMigrator::process_and_sanitize_data()privateWC 1.0

Helper function to validate and combine data before we try to insert.

Method of the class: MetaToCustomTableMigrator{}

No Hooks.

Return

Array[]. Validated and combined data with errors.

Usage

// private - for code of main (parent) class only
$result = $this->process_and_sanitize_data( $entity_data, $meta_data ): array;
$entity_data(array) (required)
Data from source table.
$meta_data(array) (required)
Data from meta table.

MetaToCustomTableMigrator::process_and_sanitize_data() code WC 8.7.0

private function process_and_sanitize_data( array $entity_data, array $meta_data ): array {
	$sanitized_entity_data = array();
	$error_records         = array();
	$this->process_and_sanitize_entity_data( $sanitized_entity_data, $error_records, $entity_data );
	$this->processs_and_sanitize_meta_data( $sanitized_entity_data, $error_records, $meta_data );

	return array(
		'data'   => $sanitized_entity_data,
		'errors' => $error_records,
	);
}