Order.php
990 Bytes
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
<?php
namespace ACA\WC\Editing\Strategy;
use AC\ListTable;
use ACA\WC\Editing;
use ACA\WC\ListTable\Orders;
use ACP;
use Automattic;
class Order implements ACP\Editing\Strategy
{
public function user_can_edit_item(int $id): bool
{
return $this->user_can_edit();
}
public function user_can_edit(): bool
{
return current_user_can('edit_shop_orders');
}
public function get_query_request_handler(): ACP\Editing\RequestHandler
{
return new Editing\RequestHandler\Query\Order();
}
public function get_total_items(): int
{
return $this->get_list_table()->get_total_items();
}
protected function get_list_table(): ListTable
{
static $list_table = null;
if (null === $list_table) {
$list_table = new Orders(
wc_get_container()->get(Automattic\WooCommerce\Internal\Admin\Orders\ListTable::class)
);
}
return $list_table;
}
}