Automattic\WooCommerce\Blocks\StoreApi
Formatters::__get() public WC 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() Formatters:: get WC 5.0.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 ];
}