Current Path : /storage/v11800/romasitenew/public_html/wp-content/plugins/webappick-product-feed-for-woocommerce/V5/Query/ |
Linux v11800 5.3.0-1023-aws #25~18.04.1-Ubuntu SMP Fri Jun 5 15:19:18 UTC 2020 aarch64
|
Current File : /storage/v11800/romasitenew/public_html/wp-content/plugins/webappick-product-feed-for-woocommerce/V5/Query/QueryFactory.php |
<?php
namespace CTXFeed\V5\Query;
use CTXFeed\V5\Utility\Config;
use CTXFeed\V5\Utility\Settings;
class QueryFactory {
/**
* @param Config $config
*
* @return array
*/
public static function get_ids( $config, $args = []) {
$template = $config->get_feed_template();
$queryType = Settings::get( 'product_query_type' );
$class = "\CTXFeed\V5\Query\\" . strtoupper( $queryType ) . "Query";
if ( strpos( $template, 'review' ) ) {
$class = WCReviewQuery::class;
}
$feedRules = $config->get_config();
/**
* Fires before looping through request product for getting product data
*
* @param int[] $productIds
* @param array $feedConfig
*
* @since 3.2.10
*/
do_action( 'woo_feed_before_product_loop', [], $feedRules, $config );
/**
* @var WPQuery|WCQuery|WCReviewQuery $class Query Class
*/
$productIds = ( new Query( new $class( $config, $args ) ) )->get_ids();
/**
* Fires after looping through request product for getting product data
*
* @param int[] $productIds
* @param Config $config
*
* @since 3.2.10
*/
do_action( 'woo_feed_after_product_loop', $productIds, $feedRules, $config );
return $productIds;
}
}