1 | <?php |
||
11 | abstract class AddStrategyAbstract implements AddStrategyInterface |
||
12 | { |
||
13 | private $adapter; |
||
14 | |||
15 | /** |
||
16 | * @param AdapterInterface $adapter |
||
17 | */ |
||
18 | 8 | public function __construct(AdapterInterface $adapter) |
|
22 | |||
23 | /** |
||
24 | * {@inheritdoc} |
||
25 | */ |
||
26 | 8 | public function add($targetNodeId, array $data = array()) |
|
53 | |||
54 | /** |
||
55 | * @param NodeInfo $targetNode |
||
56 | * |
||
57 | * @throws ValidationException If cannot move node |
||
58 | */ |
||
59 | abstract protected function canCreateNewNode(NodeInfo $targetNode): void; |
||
60 | |||
61 | /** |
||
62 | * @param NodeInfo $targetNode |
||
63 | */ |
||
64 | abstract protected function makeHole(NodeInfo $targetNode): void; |
||
65 | |||
66 | /** |
||
67 | * @param NodeInfo $targetNode |
||
68 | * |
||
69 | * @return NodeInfo |
||
70 | */ |
||
71 | abstract protected function createNewNodeNodeInfo(NodeInfo $targetNode): NodeInfo; |
||
72 | |||
73 | /** |
||
74 | * @return AdapterInterface |
||
75 | */ |
||
76 | 8 | protected function getAdapter(): AdapterInterface |
|
80 | } |
||
81 |