We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

persistent (remove, destroy)

Hi,

I have some questions regarding persistent.

  1. under what situation will persistent->remove(someIndex) fail? I have been using persistent->remove(someIndex) for months and recently it unexpectedly fail to remove.

  2. I tried persistent->destroy() and experienced strange result: if I do persistent->destroy() right after persistent->remove(someIndex) it will not destroy. If I do persistent->destroy() solely it will not destroy neither.

FYI, my Phalcon version is 2.0.6.



752
edited Sep '15

Hi. It's fixed in Phalcon 2.0.7. From https://blog.phalcon.io/ :

Fixed Session\Bag::remove()

Session\Bag::destroy() eliminates any temporary data in the variables bag



25.7k

Hi David,

Thanks for your reply. I upgraded my Phalcon but it still doesn't work. Before the upgrade the problems described above works occasionally, and when I try persistent->remove(someIndex) which someIndex is storing a very simple value (like a short string) it still doesn't work. After the upgrade, when I test removing small value it always work; but when I try to remove a multidimensional array which contains Phalcon\Acl\Role, and when I try to remove Phalcon\Acl\Adapter\Memory, they first success a few times and then they constantly fail.

Hi. It's fixed in Phalcon 2.0.7. From https://blog.phalcon.io/ :

Fixed Session\Bag::remove()

Session\Bag::destroy() eliminates any temporary data in the variables bag