<?php
/**
 * Parts Europe Filter Hook Registration
 *
 * @package    Common
 * @subpackage Hooks
 */

namespace MOWCPS\Common\Hooks;

use MOWCPS\Common\Constants\Plugin_Filters;
use MOWCPS\Common\Interfaces\Hookable_Interface;
use MOWCPS\Common\Suppliers\Parts_Europe as Parts_Europe_Supplier;

if ( ! defined( 'ABSPATH' ) ) {
	die;
}

/**
 * Class Parts_Europe
 */
class Parts_Europe implements Hookable_Interface {

	/**
	 * Initialize the Parts Europe filter hooks
	 */
	public function __construct() {
		$this->register_hooks();
	}

	/**
	 * Register WordPress hooks
	 *
	 * @return void
	 */
	public function register_hooks() {
		// Transform part_numbers array from simple values to key-value pairs
		add_filter(
			Plugin_Filters::FILTER_API_CALL_ALTERATION_FILTER,
			array( Parts_Europe_Supplier::class, 'transform_part_numbers_to_objects' ),
			10,
			1
		);
	}
}

