Automattic\WooCommerce\StoreApi
Formatters::__get
Get a new instance of a formatter class.
Method of the class: Formatters{}
No Hooks.
Returns
FormatterInterface. Formatter class instance.
Usage
$Formatters = new Formatters(); $Formatters->__get( $name );
- $name(string) (required)
- Name of the formatter.
Formatters::__get() Formatters:: get code WC 10.8.1
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 ];
}