1 | <?php namespace Arcanedev\LaravelNestedSet\Utilities; |
||
13 | class TreeHelper |
||
14 | { |
||
15 | /* ------------------------------------------------------------------------------------------------ |
||
16 | | Main Functions |
||
17 | | ------------------------------------------------------------------------------------------------ |
||
18 | */ |
||
19 | /** |
||
20 | * @param array $data |
||
21 | * @param array $existing |
||
22 | * @param \Arcanedev\LaravelNestedSet\Contracts\Nodeable $model |
||
23 | * @param bool $delete |
||
24 | * |
||
25 | * @return int |
||
26 | */ |
||
27 | 12 | public static function rebuild(array $data, $existing, Nodeable $model, $delete = false) |
|
49 | |||
50 | /** |
||
51 | * Fix nodes. |
||
52 | * |
||
53 | * @param array $dictionary |
||
54 | * |
||
55 | * @return int |
||
56 | */ |
||
57 | 12 | public static function fixNodes(array &$dictionary) |
|
72 | |||
73 | /* ------------------------------------------------------------------------------------------------ |
||
74 | | Other Functions |
||
75 | | ------------------------------------------------------------------------------------------------ |
||
76 | */ |
||
77 | /** |
||
78 | * Rebuild the dictionary. |
||
79 | * |
||
80 | * @param array $dictionary |
||
81 | * @param array $data |
||
82 | * @param array $existing |
||
83 | * @param \Arcanedev\LaravelNestedSet\Contracts\Nodeable $model |
||
84 | * @param mixed $parentId |
||
85 | * |
||
86 | * @throws \Illuminate\Database\Eloquent\ModelNotFoundException |
||
87 | */ |
||
88 | 12 | protected static function rebuildDictionary( |
|
119 | /** |
||
120 | * Reorder nodes. |
||
121 | * |
||
122 | * @param array $dictionary |
||
123 | * @param int $fixed |
||
124 | * @param int|null $parentId |
||
125 | * @param int $cut |
||
126 | * |
||
127 | * @return int |
||
128 | */ |
||
129 | 12 | protected static function reorderNodes( |
|
157 | } |
||
158 |