Shikiryu 2019-10-21 09:40:53 +02:00
parent 30d75445d9
commit 43bd7d8c0d

16
Move.md Normal file

@ -0,0 +1,16 @@
*EXPERIMENTAL*
*Syntax:* `public function move($node, $to)`
*Example:*
```php
xmldb->move($xmldbtest->selectFromPK('table1', 'search', 'node'), 'table2');
```
This will move the item with a PK = "search" from _table1_ to _table2_.
Tables must be present before the movement or it will return @false@.
*TODO:* The first goal of this function is to move the element to a precise location and not just append it into another table.
The only way found is to use the DOMDocument function `insertBefore`. We just need to calculate the index of the index... after ;).