1 | <?php |
||
22 | abstract class BlockManager |
||
23 | { |
||
24 | |||
25 | /** |
||
26 | * @var CollectionInterface|BlockInterface[] $blocks |
||
27 | */ |
||
28 | protected $blocks; |
||
29 | |||
30 | /** |
||
31 | * @var RequestInterface $request |
||
32 | */ |
||
33 | protected $request; |
||
34 | |||
35 | /** |
||
36 | * the post type that the current request applies to |
||
37 | * |
||
38 | * @var string $request_post_type |
||
39 | */ |
||
40 | protected $request_post_type; |
||
41 | |||
42 | /** |
||
43 | * value of the 'page' $_GET param |
||
44 | * |
||
45 | * @var string $page |
||
46 | */ |
||
47 | protected $page; |
||
48 | |||
49 | /** |
||
50 | * value of the 'action' $_GET param |
||
51 | * |
||
52 | * @var string $action |
||
53 | */ |
||
54 | protected $action; |
||
55 | |||
56 | |||
57 | /** |
||
58 | * BlockManager constructor. |
||
59 | * |
||
60 | * @param BlockCollection $blocks |
||
61 | * @param RequestInterface $request |
||
62 | */ |
||
63 | public function __construct( |
||
74 | |||
75 | |||
76 | /** |
||
77 | * Returns the name of a hookpoint to be used to call initialize() |
||
78 | * |
||
79 | * @return string |
||
80 | */ |
||
81 | abstract public function init_hook(); |
||
82 | |||
83 | |||
84 | /** |
||
85 | * Perform any early setup required for block editors to functions |
||
86 | * |
||
87 | * @return void |
||
88 | */ |
||
89 | abstract public function initialize(); |
||
90 | |||
91 | |||
92 | /** |
||
93 | * @return string |
||
94 | */ |
||
95 | public function currentRequestPostType() |
||
99 | } |
||
100 |