Automattic\WooCommerce\StoreApi\Routes\V1\Ucp
AbstractCatalogRoute::mapper
Get the product mapper for the response being built.
Метод класса: AbstractCatalogRoute{}
Хуков нет.
Возвращает
UcpProductMapper.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->mapper(): UcpProductMapper;
Код AbstractCatalogRoute::mapper() AbstractCatalogRoute::mapper 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;
}