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