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