src/WooCommerce/Shop/InvoiceManager.php
protected function query2Sources(array $args, $invoiceSourceType, $sort = true)
    {
        $this->getLog()->info('WooCommerce\InvoiceManager::query2Sources: args = %s', str_replace(array(' ', "\r", "\n", "\t"), '', var_export($args, true)));
        // Add default arguments.
        $args = $args + array(
                'fields' => 'ids',
                'posts_per_page' => -1,
                'post_type' => $this->sourceTypeToShopType($invoiceSourceType),
                'post_status' => array_keys(wc_get_order_statuses()),
            );
        $query = new WP_Query($args);
        $ids = $query->get_posts();
        if ($sort) {
            sort($ids);
        }
        return $this->getSourcesByIdsOrSources($invoiceSourceType, $ids);
    }
protected function query2Sources(array $args, $invoiceSourceType, $sort = true)
    {
        $this->getLog()->info('WooCommerce\InvoiceManager::query2Sources: args = %s', str_replace(array(' ', "\r", "\n", "\t"), '', var_export($args, true)));
        // Add default arguments.
        $args = $args + array(
                'fields' => 'ids',
                'posts_per_page' => -1,
                'post_type' => $this->sourceTypeToShopType($invoiceSourceType),
                'post_status' => array_keys(wc_get_order_statuses()),
            );
        $query = new WP_Query($args);
        $ids = $query->get_posts();
        if ($sort) {
            sort($ids);
        }
        return $this->getSourcesByIdsOrSources($invoiceSourceType, $ids);
    }
protected function query2Sources ( array $ args , $ invoiceSourceType , $ sort = true ) { $ this -> getLog ( ) -> info ( 'WooCommerce\InvoiceManager::query2Sources: args = %s' , str_replace ( array ( ' ' , "\r" , "\n" , "\t" ) , '' , var_export ( $ args , true ) ) ) ; // Add default arguments. $ args = $ args + array ( 'fields' => 'ids' , 'posts_per_page' => - 1 , 'post_type' => $ this -> sourceTypeToShopType ( $ invoiceSourceType ) , 'post_status' => array_keys ( wc_get_order_statuses ( ) ) , ) ; $ query = new WP_Query ( $ args ) ; $ ids = $ query -> get_posts ( ) ; if ( $ sort ) { sort ( $ ids ) ; } return $ this -> getSourcesByIdsOrSources ( $ invoiceSourceType , $ ids ) ; }
Helper method to get a list of Source given a set of query arguments.

@param array $args
@param string $invoiceSourceType
@param bool $sort

@return \Siel\Acumulus\Invoice\Source[]
Helper method to get a list of Source given a set of query arguments .