Order.php
1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
declare(strict_types=1);
namespace ACA\WC\ListScreen;
use AC;
use AC\ColumnRepository;
use AC\Type\Uri;
use ACA\WC\Editing;
use ACA\WC\Export;
use ACA\WC\ListTable\ManageValue;
use ACA\WC\ListTable\Orders;
use ACA\WC\Sorting;
use ACA\WC\Type\OrderTableUrl;
use ACP;
use Automattic;
class Order extends AC\ListScreen implements ACP\Export\ListScreen, ACP\Editing\ListScreen,
AC\ListScreen\ManageValue, AC\ListScreen\ListTable
{
private $column_config;
public function __construct(array $column_config)
{
parent::__construct('wc_order', 'woocommerce_page_wc-orders');
$this->label = __('Orders', 'woocommerce');
$this->meta_type = 'wc_order';
$this->group = 'woocommerce';
$this->column_config = $column_config;
}
public function list_table(): AC\ListTable
{
return new Orders(
wc_get_container()->get(Automattic\WooCommerce\Internal\Admin\Orders\ListTable::class)
);
}
public function get_list_table()
{
return wc_get_container()->get(Automattic\WooCommerce\Internal\Admin\Orders\ListTable::class);
}
protected function get_object($id)
{
return wc_get_order($id);
}
public function get_table_url(): Uri
{
return new OrderTableUrl($this->has_id() ? $this->get_id() : null);
}
public function manage_value(): AC\Table\ManageValue
{
return new ManageValue\Order('shop_order', new ColumnRepository($this));
}
protected function register_column_types(): void
{
$this->register_column_types_from_list($this->column_config);
}
public function editing()
{
return new Editing\Strategy\Order();
}
public function export()
{
return new Export\Strategy\Order($this);
}
}