Jump to content

Difference betweeen $page->delete() and $page->trash()


Francesco Bortolussi
 Share

Recommended Posts

Recently I was in trouble filling a repeater inside a foreach loop (Creating pages from a CVS File).

One of the steps in my script was delete all existing pages before start creating new ones.

Discovered that after using $page->delete() and create a new page I could't fill my repeater fields.

Then if I use $page->trash() no problem, and the repeater's were created and correctly filled.

What's the difference between delete and trash?

Is there some internal pointer that get lost when delete() is called affecting the behaviour of the New() function or getNew()?

The original problem is in this tread:

https://processwire.com/talk/topic/11130-problem-addingpopulating-repeater-using-api/

Thank's.

Link to comment
Share on other sites

Delete is permanent (be careful with that) deletion/removal of that record (from the database)....trash is well, send it to the trash...can be retrieved later in case you change your mind (unless of course you empty the trash, then its deleted).....

http://cheatsheet.processwire.com/

Welcome to the forums :-)

Edited by kongondo
  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...