This site has been archived. To learn more about our current products Ibexa Content, Ibexa Experience, Ibexa Commerce head over to the Ibexa Developer Portal
Monday 17 June 2013 10:16:37 pm - 3 replies
Hi everybody!
I am trying to move a content object using the public APi, but I can't find how to do so.
I looked at the contentUpdateStruct but I do not see anything allowing me to change the content location. I can't just change the mainLocationId neither because it is read-only.
Is this even possible?
Thank you for any help.
Modified on Monday 17 June 2013 10:17:19 pm by Julien Montavit
Monday 17 June 2013 10:55:33 pm
Maybe de updateLocation() method?
Some code in https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Publish/API/Repository/Tests/LocationServiceTest.php
Monday 17 June 2013 11:15:10 pm
Yes,
you can using the Location service for moving the location of content below a other parent location.
$repository = $this->getRepository(); $locationService = $repository->getLocationService(); // Load a location and new parent location $location = $locationService->loadLocation( [location_id] ); $newParentLocation = $locationService->loadLocation( [new_parent_location_id] ); $locationService->moveSubtree( Location $location, Location $newParentLocation );
If i can help you ?
You must be logged in to post messages in this topic!