Propel Nested Set Undelete Soft Deleted

I use propel and soft delete and propel nested set.

  • When I delete a node without children and then do $node->undelete() everything is fine, node is recovering from soft delete.
  • But if a node have children and delete it then if I do $node->undelete() it recovers only the node without any children....

¿Alguna idea o solución?

preguntado el 31 de julio de 12 a las 15:07

1 Respuestas

Si, el undelete() method is pretty simple, all it does it nullify the deleted_at column on that exact table. However, if you have the soft delete behavior on the sub table as well, then you could do this:

SubTableQuery::create()
  ->includeDeleted()
  ->filterByParentId($parentRecord->getId())
  ->unDelete();
$parentRecord->unDelete();

Respondido el 09 de enero de 13 a las 16:01

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.