Automattic\WooCommerce\StoreApi

Formatters::__get()publicWC 1.0

Get a new instance of a formatter class.

Метод класса: Formatters{}

Хуков нет.

Возвращает

FormatterInterface. Formatter class instance.

Использование

$Formatters = new Formatters();
$Formatters->__get( $name );
$name(строка) (обязательный)
Name of the formatter.

Код Formatters::__get() WC 8.7.0

public function __get( $name ) {
	if ( ! isset( $this->formatters[ $name ] ) ) {
		if ( defined( 'WP_DEBUG' ) && WP_DEBUG && current_user_can( 'manage_woocommerce' ) ) {
			throw new Exception( $name . ' formatter does not exist' );
		}
		return new DefaultFormatter();
	}
	return $this->formatters[ $name ];
}