src/Controller/Framework/DocTreeController.php
/**
     * Updates a set of items in the document from the tree view
     * Reorders are done by updating the listEnum fields of the items
     * This also does copies, of either single items or folders.
     * If we do a copy, the service returns an array of trees with the copied lsItemIds.
     * For other operations, we return an empty array.
     *
     * @Route("/doc/{id}/updateitems.{_format}", methods={"POST"}, name="doctree_update_items")
     * @Security("is_granted('edit', lsDoc)")
     * @Template()
     */
Updates a set of items in the document from the tree view
Reorders are done by updating the listEnum fields of the items
This also does copies, of either single items or folders.
If we do a copy, the service returns an array of trees with the copied lsItemIds.
For other operations, we return an empty array.


Updates a set of items in the document from the tree view Reorders are done by updating the listEnum fields of the items This also does copies of either single items or folders . If we do a copy the service returns an array of trees with the copied lsItemIds . For other operations we return an empty array .
public function updateItemsAction(Request $request, LsDoc $lsDoc, string $_format = 'json'): array
    {
        $command = new UpdateTreeItemsCommand($lsDoc, $request->request->get('lsItems'));
        $this->sendCommand($command);
        $rv = $command->getReturnValues();
        foreach ($rv as $lsItemId => $val) {
            if (!empty($rv[$lsItemId]['association'])) {
                $rv[$lsItemId]['assocId'] = $rv[$lsItemId]['association']->getId();
                unset($rv[$lsItemId]['association']);
            }
            if (!empty($rv[$lsItemId]['lsItem'])) {
                $rv[$lsItemId]['lsItemId'] = $rv[$lsItemId]['lsItem']->getId();
                unset($rv[$lsItemId]['lsItem']);
            }
        }
        return ['returnedItems' => $rv];
    }
public function updateItemsAction ( Request $ request , LsDoc $ lsDoc , string $ _format = 'json' ) : array { $ command = new UpdateTreeItemsCommand ( $ lsDoc , $ request -> request -> get ( 'lsItems' ) ) ; $ this -> sendCommand ( $ command ) ; $ rv = $ command -> getReturnValues ( ) ; foreach ( $ rv as $ lsItemId => $ val ) { if ( ! empty ( $ rv [ $ lsItemId ] [ 'association' ] ) ) { $ rv [ $ lsItemId ] [ 'assocId' ] = $ rv [ $ lsItemId ] [ 'association' ] -> getId ( ) ; unset ( $ rv [ $ lsItemId ] [ 'association' ] ) ; } if ( ! empty ( $ rv [ $ lsItemId ] [ 'lsItem' ] ) ) { $ rv [ $ lsItemId ] [ 'lsItemId' ] = $ rv [ $ lsItemId ] [ 'lsItem' ] -> getId ( ) ; unset ( $ rv [ $ lsItemId ] [ 'lsItem' ] ) ; } } return [ 'returnedItems' => $ rv ] ; }
Updates a set of items in the document from the tree view
 Reorders are done by updating the listEnum fields of the items
 This also does copies, of either single items or folders.
Updates a set of items in the document from the tree view Reorders are done by updating the listEnum fields of the items This also does copies of either single items or folders .
// get ids for new associations and items