eZ Community » Forums » Developer » Best way to remove node
expandshrink

Best way to remove node

Best way to remove node

Friday 12 April 2013 10:05:07 am - 1 reply

Hi,

I've needed to remove node in my script. What is the best method to remove properly a node ?

I found 3 methods :

  • eZPersistentObject::removeObject (eZContentObject::definition(), array ('id'=>$intObjectId));
  • $objObjectToDelete->removeThis();
  • eZContentOperationCollection::deleteObject( $objObjectToDelete->MainNodeID, false );
  • another ?

Thanks for your reply !

Monday 15 April 2013 11:12:42 am

I use the following, called with an exec() in php:

 php bin/php/ezsubtreeremove.php --nodes-id=<node-id> --ignore-trash

ignore-trash is optional - with the flag set the product is deleted outright. 

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from