> */ private static $stores = array( 'order_language' => 'PLLWC_Order_Language_CPT', 'product_language' => 'PLLWC_Product_Language_CPT', ); /** * Loads a data store. * * @since 1.0 * * @throws Exception If the data store doesn't exist. * * @param TKey $object_type Identifier for the data store, typically 'order_language' or 'product_language'. * @return TValue */ public static function load( $object_type ) { /** * Filters the list of available data stores. * * @since 1.0 * * @param array> $stores Available data stores. */ self::$stores = apply_filters( 'pllwc_data_stores', self::$stores ); /** @var class-string */ $store = self::$stores[ $object_type ]; if ( class_exists( $store ) ) { return new $store(); } throw new Exception( 'Invalid data store.' ); } }