# woocommerce-pos/1.10.2/includes/API/V2/Writers/Collection_Writer_Resolver.php

WCPOS – Point of Sale (POS) plugin for WooCommerce, version 1.10.2. 41 lines.

- Page: https://pluginprobe.com/plugins/woocommerce-pos/1.10.2/code/includes/API/V2/Writers/Collection_Writer_Resolver.php
- Raw: https://pluginprobe.com/plugins/woocommerce-pos/1.10.2/raw/includes/API/V2/Writers/Collection_Writer_Resolver.php
- Modified: 2026-08-25T07:52:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/woocommerce-pos/1.10.2/code/includes/API/V2/Writers/Collection_Writer_Resolver.php#L10-L20`.

```php
<?php
/**
 * Collection writer resolver.
 *
 * @package WCPOS\WooCommercePOS\API\V2\Writers
 */

// phpcs:disable Squiz.Commenting, Generic.Commenting -- Lifecycle docblocks are intentionally concise.

namespace WCPOS\WooCommercePOS\API\V2\Writers;

use WCPOS\WooCommercePOS\Interfaces\Collection_Writer_Interface;
use WCPOS\WooCommercePOS\Sync\Mutation_Store;
use WCPOS\WooCommercePOS\Sync\Order_Write_Payload;

/** Resolves registry metadata to one collection writer. */
final class Collection_Writer_Resolver {
	/** @var object Mutation store for order audit persistence. */
	private $store;

	/** Construct the resolver. */
	public function __construct( ?object $store = null ) {
		$this->store = $store ?? new Mutation_Store();
	}

	/** Resolve with the variation post-type override before the shared post id type. */
	public function resolve( array $meta ): Collection_Writer_Interface {
		if ( 'product_variation' === ( $meta['post_type'] ?? '' ) ) {
			return new Variation_Writer();
		}
		switch ( $meta['id_type'] ?? '' ) {
			case 'order':
				return new Order_Writer( $this->store, new Order_Write_Payload() );
			case 'user':
				return new Customer_Writer();
			default:
				return new Null_Writer();
		}
	}
}

```
