Automattic\WooCommerce\StoreApi\Routes\V1\Ucp

AbstractCatalogRoute::mapper │ protected │ WC 1.0

Get the product mapper for the response being built.

Method of the class: AbstractCatalogRoute{}

No Hooks.

Returns

UcpProductMapper.

Usage

// protected - for code of main (parent) or child class
$result = $this->mapper(): UcpProductMapper;

AbstractCatalogRoute::mapper() code WC 11.3.0

protected function mapper(): UcpProductMapper {
	if ( null === $this->mapper ) {
		/**
		 * The controller returns the registered subclass; typed for static analysis.
		 *
		 * @var UcpProductSchema $schema
		 */
		$schema       = $this->schema_controller->get( UcpProductSchema::IDENTIFIER );
		$this->mapper = new UcpProductMapper( $this->store_currency(), $schema );
	}

	return $this->mapper;
}