PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.18
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.18
1.10.18 1.10.17 1.10.16 1.10.15 1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 1.10.1 1.10.0 1.9.17 1.9.15 1.9.16 1.9.14 1.9.13 All 162 releases
woocommerce-pos / includes / API / Order_Search.php

Order_Search.php in WCPOS – Point of Sale (POS) plugin for WooCommerce 1.10.18, at includes/API/Order_Search.php

61 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Legacy WCPOS search API; retained for Pro for one release.
4 *
5 * @package WCPOS\WooCommercePOS\API
6 */
7
8 namespace WCPOS\WooCommercePOS\API;
9
10 use WCPOS\WooCommercePOS\Sync\Collection_Rules;
11 use WCPOS\WooCommercePOS\Sync\Order_Search as Search_Rule;
12
13 /**
14 * Legacy search entry points.
15 *
16 * @deprecated Search is owned by Sync\Collection_Rules.
17 */
18 final class Order_Search {
19 /**
20 * Split order search terms.
21 *
22 * @deprecated Use the Collection Rules plan.
23 *
24 * @param string $search Search text.
25 * @return string[]
26 */
27 public static function terms( string $search ): array {
28 return Search_Rule::terms( $search, Collection_Rules::rules( 'orders' )['search'] );
29 }
30 /**
31 * Build HPOS order search SQL.
32 *
33 * @deprecated Use the Collection Rules plan.
34 *
35 * @param string $search Search text.
36 * @param object $query Orders table query.
37 * @return string
38 */
39 public static function hpos_where( string $search, $query ): string {
40 return Search_Rule::hpos_where(
41 $search,
42 array(
43 'orders' => $query->get_table_name( 'orders' ),
44 'addresses' => $query->get_table_name( 'addresses' ),
45 ),
46 Collection_Rules::rules( 'orders' )['search']
47 );
48 }
49 /**
50 * Build legacy order search SQL.
51 *
52 * @deprecated Use the Collection Rules plan.
53 *
54 * @param string $search Search text.
55 * @return string
56 */
57 public static function posts_where( string $search ): string {
58 return Search_Rule::posts_where( $search, Collection_Rules::rules( 'orders' )['search'] );
59 }
60 }
61