WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\StoreApi

RoutesController::initialize() protected WC 1.0

Load route class instances.

{} It's a method of the class: RoutesController{}

No Hooks.

Return

null. Nothing.

Usage

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

Code of RoutesController::initialize() WC 5.8.0

protected function initialize() {
	global $wp_version;

	$cart_controller  = new CartController();
	$order_controller = new OrderController();

	$this->routes = [
		'cart'                      => new Routes\Cart( $this->schemas->get( 'cart' ), null, $cart_controller ),
		'cart-add-item'             => new Routes\CartAddItem( $this->schemas->get( 'cart' ), null, $cart_controller ),
		'cart-apply-coupon'         => new Routes\CartApplyCoupon( $this->schemas->get( 'cart' ), null, $cart_controller ),
		'cart-coupons'              => new Routes\CartCoupons( $this->schemas->get( 'cart' ), $this->schemas->get( 'cart-coupon' ), $cart_controller ),
		'cart-coupons-by-code'      => new Routes\CartCouponsByCode( $this->schemas->get( 'cart' ), $this->schemas->get( 'cart-coupon' ), $cart_controller ),
		'cart-extensions'           => new Routes\CartExtensions( $this->schemas->get( 'cart' ), $this->schemas->get( 'cart-extensions' ), $cart_controller ),
		'cart-items'                => new Routes\CartItems( $this->schemas->get( 'cart' ), $this->schemas->get( 'cart-item' ), $cart_controller ),
		'cart-items-by-key'         => new Routes\CartItemsByKey( $this->schemas->get( 'cart' ), $this->schemas->get( 'cart-item' ), $cart_controller ),
		'cart-remove-coupon'        => new Routes\CartRemoveCoupon( $this->schemas->get( 'cart' ), null, $cart_controller ),
		'cart-remove-item'          => new Routes\CartRemoveItem( $this->schemas->get( 'cart' ), null, $cart_controller ),
		'cart-select-shipping-rate' => new Routes\CartSelectShippingRate( $this->schemas->get( 'cart' ), null, $cart_controller ),
		'cart-update-item'          => new Routes\CartUpdateItem( $this->schemas->get( 'cart' ), null, $cart_controller ),
		'cart-update-customer'      => new Routes\CartUpdateCustomer( $this->schemas->get( 'cart' ), null, $cart_controller ),
		'checkout'                  => new Routes\Checkout( $this->schemas->get( 'cart' ), $this->schemas->get( 'checkout' ), $cart_controller, $order_controller ),
		'product-attributes'        => new Routes\ProductAttributes( $this->schemas->get( 'product-attribute' ) ),
		'product-attributes-by-id'  => new Routes\ProductAttributesById( $this->schemas->get( 'product-attribute' ) ),
		'product-attribute-terms'   => new Routes\ProductAttributeTerms( $this->schemas->get( 'term' ) ),
		'product-categories'        => new Routes\ProductCategories( $this->schemas->get( 'product-category' ) ),
		'product-categories-by-id'  => new Routes\ProductCategoriesById( $this->schemas->get( 'product-category' ) ),
		'product-collection-data'   => new Routes\ProductCollectionData( $this->schemas->get( 'product-collection-data' ) ),
		'product-reviews'           => new Routes\ProductReviews( $this->schemas->get( 'product-review' ) ),
		'product-tags'              => new Routes\ProductTags( $this->schemas->get( 'term' ) ),
		'products'                  => new Routes\Products( $this->schemas->get( 'product' ) ),
		'products-by-id'            => new Routes\ProductsById( $this->schemas->get( 'product' ) ),
	];

	// Batching requires WP 5.6.
	if ( version_compare( $wp_version, '5.6', '>=' ) ) {
		$this->routes['batch'] = new Routes\Batch();
	}
}